Skip to content

Commit

Permalink
Migrate toward java.util.function.Predicate
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Jul 10, 2024
1 parent 0bfe65b commit 2965ea1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,8 @@ public Predicate<? super T>[] getPredicates() {
return FunctorUtils.<T>copy(iPredicates);
}

@Override
public boolean evaluate(final T object) {
return test(object);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public AllPredicate(final Predicate<? super T>... predicates) {
* @return true if all decorated predicates return true
*/
@Override
public boolean evaluate(final T object) {
public boolean test(final T object) {
for (final Predicate<? super T> iPredicate : iPredicates) {
if (!iPredicate.evaluate(object)) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public AnyPredicate(final Predicate<? super T>... predicates) {
* @return true if any decorated predicate return true
*/
@Override
public boolean evaluate(final T object) {
public boolean test(final T object) {
for (final Predicate<? super T> iPredicate : iPredicates) {
if (iPredicate.evaluate(object)) {
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public NonePredicate(final Predicate<? super T>... predicates) {
* @return true if none of decorated predicates return true
*/
@Override
public boolean evaluate(final T object) {
public boolean test(final T object) {
for (final Predicate<? super T> iPredicate : iPredicates) {
if (iPredicate.evaluate(object)) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public OnePredicate(final Predicate<? super T>... predicates) {
* @return true if only one decorated predicate returns true
*/
@Override
public boolean evaluate(final T object) {
public boolean test(final T object) {
boolean match = false;
for (final Predicate<? super T> iPredicate : iPredicates) {
if (iPredicate.evaluate(object)) {
Expand Down

0 comments on commit 2965ea1

Please sign in to comment.