public final class AllPredicate extends java.lang.Object implements Predicate, PredicateDecorator, java.io.Serializable
NOTE: In versions prior to 3.2 an array size of zero or one threw an exception.
Constructor and Description |
---|
AllPredicate(Predicate[] predicates)
Constructor that performs no validation.
|
Modifier and Type | Method and Description |
---|---|
boolean |
evaluate(java.lang.Object object)
Evaluates the predicate returning true if all predicates return true.
|
static Predicate |
getInstance(java.util.Collection predicates)
Factory to create the predicate.
|
static Predicate |
getInstance(Predicate[] predicates)
Factory to create the predicate.
|
Predicate[] |
getPredicates()
Gets the predicates, do not modify the array.
|
public AllPredicate(Predicate[] predicates)
getInstance
if you want that.predicates
- the predicates to check, not cloned, not nullpublic static Predicate getInstance(Predicate[] predicates)
If the array is size zero, the predicate always returns true. If the array is size one, then that predicate is returned.
predicates
- the predicates to check, cloned, not nullall
predicatejava.lang.IllegalArgumentException
- if the predicates array is nulljava.lang.IllegalArgumentException
- if any predicate in the array is nullpublic static Predicate getInstance(java.util.Collection predicates)
If the collection is size zero, the predicate always returns true. If the collection is size one, then that predicate is returned.
predicates
- the predicates to check, cloned, not nullall
predicatejava.lang.IllegalArgumentException
- if the predicates array is nulljava.lang.IllegalArgumentException
- if any predicate in the array is nullpublic boolean evaluate(java.lang.Object object)
public Predicate[] getPredicates()
getPredicates
in interface PredicateDecorator
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"