mirror of
https://github.com/apache/commons-collections.git
synced 2025-02-10 03:56:11 +00:00
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);
|
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
|
* @return true if all decorated predicates return true
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean evaluate(final T object) {
|
public boolean test(final T object) {
|
||||||
for (final Predicate<? super T> iPredicate : iPredicates) {
|
for (final Predicate<? super T> iPredicate : iPredicates) {
|
||||||
if (!iPredicate.evaluate(object)) {
|
if (!iPredicate.evaluate(object)) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -101,7 +101,7 @@ public final class AnyPredicate<T> extends AbstractQuantifierPredicate<T> {
|
|||||||
* @return true if any decorated predicate return true
|
* @return true if any decorated predicate return true
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean evaluate(final T object) {
|
public boolean test(final T object) {
|
||||||
for (final Predicate<? super T> iPredicate : iPredicates) {
|
for (final Predicate<? super T> iPredicate : iPredicates) {
|
||||||
if (iPredicate.evaluate(object)) {
|
if (iPredicate.evaluate(object)) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -91,7 +91,7 @@ public final class NonePredicate<T> extends AbstractQuantifierPredicate<T> {
|
|||||||
* @return true if none of decorated predicates return true
|
* @return true if none of decorated predicates return true
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean evaluate(final T object) {
|
public boolean test(final T object) {
|
||||||
for (final Predicate<? super T> iPredicate : iPredicates) {
|
for (final Predicate<? super T> iPredicate : iPredicates) {
|
||||||
if (iPredicate.evaluate(object)) {
|
if (iPredicate.evaluate(object)) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -92,7 +92,7 @@ public final class OnePredicate<T> extends AbstractQuantifierPredicate<T> {
|
|||||||
* @return true if only one decorated predicate returns true
|
* @return true if only one decorated predicate returns true
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean evaluate(final T object) {
|
public boolean test(final T object) {
|
||||||
boolean match = false;
|
boolean match = false;
|
||||||
for (final Predicate<? super T> iPredicate : iPredicates) {
|
for (final Predicate<? super T> iPredicate : iPredicates) {
|
||||||
if (iPredicate.evaluate(object)) {
|
if (iPredicate.evaluate(object)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user