public final class NonePredicate extends Object implements Predicate, PredicateDecorator, 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(Object object)
Evaluates the predicate returning false if any stored predicate returns false.
|
static Predicate |
getInstance(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
predicateIllegalArgumentException
- if the predicates array is nullIllegalArgumentException
- if any predicate in the array is nullpublic static Predicate getInstance(Collection predicates)
If the collection is size zero, the predicate always returns true.
predicates
- the predicates to check, cloned, not nullone
predicateIllegalArgumentException
- if the predicates array is nullIllegalArgumentException
- if any predicate in the array is nullpublic boolean evaluate(Object object)
public Predicate[] getPredicates()
getPredicates
in interface PredicateDecorator
Copyright © 2001–2015 The Apache Software Foundation. All rights reserved.