|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.collections4.functors.AbstractQuantifierPredicate<T>
org.apache.commons.collections4.functors.AllPredicate<T>
public final class AllPredicate<T>
Predicate implementation that returns true if all the predicates return true. If the array of predicates is empty, then this predicate returns true.
NOTE: In versions prior to 3.2 an array size of zero or one threw an exception.
Field Summary |
---|
Fields inherited from class org.apache.commons.collections4.functors.AbstractQuantifierPredicate |
---|
iPredicates |
Constructor Summary | |
---|---|
AllPredicate(Predicate<? super T>... predicates)
Constructor that performs no validation. |
Method Summary | ||
---|---|---|
static
|
allPredicate(Collection<? extends Predicate<T>> predicates)
Factory to create the predicate. |
|
static
|
allPredicate(Predicate<? super T>... predicates)
Factory to create the predicate. |
|
boolean |
evaluate(T object)
Evaluates the predicate returning true if all predicates return true. |
Methods inherited from class org.apache.commons.collections4.functors.AbstractQuantifierPredicate |
---|
getPredicates |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AllPredicate(Predicate<? super T>... predicates)
allPredicate
if you want that.
predicates
- the predicates to check, not cloned, not nullMethod Detail |
---|
public static <T> Predicate<T> allPredicate(Predicate<? super T>... predicates)
If the array is size zero, the predicate always returns true. If the array is size one, then that predicate is returned.
T
- the type that the predicate queriespredicates
- the predicates to check, cloned, not null
all
predicate
IllegalArgumentException
- if the predicates array is null
IllegalArgumentException
- if any predicate in the array is nullpublic static <T> Predicate<T> allPredicate(Collection<? extends Predicate<T>> predicates)
If the collection is size zero, the predicate always returns true. If the collection is size one, then that predicate is returned.
T
- the type that the predicate queriespredicates
- the predicates to check, cloned, not null
all
predicate
IllegalArgumentException
- if the predicates array is null
IllegalArgumentException
- if any predicate in the array is nullpublic boolean evaluate(T object)
evaluate
in interface Predicate<T>
object
- the input object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |