public final class AnyPredicate<T> extends AbstractQuantifierPredicate<T>
NOTE: In versions prior to 3.2 an array size of zero or one threw an exception.
Constructor and Description |
---|
AnyPredicate(Predicate<? super T>... predicates)
Constructor that performs no validation.
|
Modifier and Type | Method and Description |
---|---|
static <T> Predicate<T> |
anyPredicate(java.util.Collection<? extends Predicate<? super T>> predicates)
Factory to create the predicate.
|
static <T> Predicate<T> |
anyPredicate(Predicate<? super T>... predicates)
Factory to create the predicate.
|
boolean |
evaluate(T object)
Evaluates the predicate returning true if any predicate returns true.
|
getPredicates
public static <T> Predicate<T> anyPredicate(Predicate<? super T>... predicates)
If the array is size zero, the predicate always returns false. If the array is size one, then that predicate is returned.
T
- the type that the predicate queriespredicates
- the predicates to check, cloned, not nullany
predicatejava.lang.NullPointerException
- if the predicates array is nulljava.lang.NullPointerException
- if any predicate in the array is nullpublic static <T> Predicate<T> anyPredicate(java.util.Collection<? extends Predicate<? super T>> predicates)
If the collection is size zero, the predicate always returns false. If the collection is size one, then that predicate is returned.
T
- the type that the predicate queriespredicates
- the predicates to check, cloned, not nullall
predicatejava.lang.NullPointerException
- if the predicates array is nulljava.lang.NullPointerException
- if any predicate in the array is nullpublic boolean evaluate(T object)
object
- the input object"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"