Skip to content

Commit

Permalink
Changed some new method names
Browse files Browse the repository at this point in the history
  • Loading branch information
bobaikato committed Jul 11, 2023
1 parent 5149a1b commit 271121c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/main/java/art/cutils/function/Condition.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public interface Condition {
* @return a composed condition that represents the short-circuiting logical NOT of this condition
*/
@Contract(pure = true)
static @NotNull Condition areAnyMet(final Condition @NotNull ... conditions) {
static @NotNull Condition anyMet(final Condition @NotNull ... conditions) {
return () -> Arrays.stream(conditions).anyMatch(Condition::isMet);
}

Expand All @@ -66,7 +66,7 @@ public interface Condition {
* @return a composed condition that represents the short-circuiting logical NOT of this condition
*/
@Contract(pure = true)
static @NotNull Condition areNoneMet(final Condition @NotNull ... conditions) {
static @NotNull Condition noneMet(final Condition @NotNull ... conditions) {
return () -> Arrays.stream(conditions).noneMatch(Condition::isMet);
}

Expand All @@ -77,7 +77,7 @@ public interface Condition {
* @return a composed condition that represents the short-circuiting logical NOT of this condition
*/
@Contract(pure = true)
static @NotNull Condition areAllNotMet(final Condition @NotNull ... conditions) {
static @NotNull Condition allMet(final Condition @NotNull ... conditions) {
return () -> Arrays.stream(conditions).anyMatch(Condition::isNotMet);
}

Expand Down
6 changes: 3 additions & 3 deletions src/test/java/functions/ConditionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,22 +141,22 @@ void areAnyMet() {
final Condition firstCondition = () -> true;
final Condition secondCondition = () -> false;

Assertions.assertTrue(Condition.areAnyMet(firstCondition, secondCondition).isMet());
Assertions.assertTrue(Condition.anyMet(firstCondition, secondCondition).isMet());
}

@Test
void areNoneMet() {
final Condition firstCondition = () -> false;
final Condition secondCondition = () -> false;

Assertions.assertTrue(Condition.areNoneMet(firstCondition, secondCondition).isMet());
Assertions.assertTrue(Condition.noneMet(firstCondition, secondCondition).isMet());
}

@Test
void areAllNotMet() {
final Condition firstCondition = () -> false;
final Condition secondCondition = () -> false;

Assertions.assertTrue(Condition.areAllNotMet(firstCondition, secondCondition).isMet());
Assertions.assertTrue(Condition.allMet(firstCondition, secondCondition).isMet());
}
}

0 comments on commit 271121c

Please sign in to comment.