public final class NonePredicate 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 |
---|
NonePredicate(Predicate[] predicates)
Constructor that performs no validation.
|
Modifier and Type | Method and Description |
---|---|
boolean |
evaluate(java.lang.Object object)
Evaluates the predicate returning false if any stored predicate returns false.
|
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 NonePredicate(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.
predicates
- the predicates to check, cloned, not nullany
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.
predicates
- the predicates to check, cloned, not nullone
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"