Migrate toward java.util.function.Predicate
This commit is contained in:
parent
0bfe65b691
commit
2965ea1484
|
@ -53,4 +53,8 @@ public abstract class AbstractQuantifierPredicate<T> implements PredicateDecorat
|
|||
return FunctorUtils.<T>copy(iPredicates);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean evaluate(final T object) {
|
||||
return test(object);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -104,7 +104,7 @@ public final class AllPredicate<T> extends AbstractQuantifierPredicate<T> {
|
|||
* @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;
|
||||
|
|
|
@ -101,7 +101,7 @@ public final class AnyPredicate<T> extends AbstractQuantifierPredicate<T> {
|
|||
* @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;
|
||||
|
|
|
@ -91,7 +91,7 @@ public final class NonePredicate<T> extends AbstractQuantifierPredicate<T> {
|
|||
* @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;
|
||||
|
|
|
@ -92,7 +92,7 @@ public final class OnePredicate<T> extends AbstractQuantifierPredicate<T> {
|
|||
* @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)) {
|
||||
|
|
Loading…
Reference in New Issue