Skip to content

Commit

Permalink
Merge pull request #42 from charvam/master
Browse files Browse the repository at this point in the history
Extends fiats exceptions.
  • Loading branch information
generalbytes authored Apr 20, 2021
2 parents fbf741b + 7c67e89 commit 6521f87
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
projectVersion=2.2.3
projectVersion=2.3.1
pf4jVersion=3.4.0
xchangeVersion=5.0.4
requiredEverytradeVersion=>=20210303
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,14 @@ public static List<Currency> getFiats() {
}

public static Set<Currency> getFiatsExcept(Currency exception) {
return getFiatsExcept(Set.of(exception));
}

public static Set<Currency> getFiatsExcept(Set<Currency> exceptions) {
return Arrays
.stream(values())
.filter(Currency::isFiat)
.filter(it -> !exception.equals(it))
.filter(it -> !exceptions.contains(it))
.collect(Collectors.toCollection(() -> EnumSet.noneOf(Currency.class)));
}
}

0 comments on commit 6521f87

Please sign in to comment.