public final class AndPredicate<T> extends Object implements PredicateDecorator<T>, Serializable
Constructor and Description |
---|
AndPredicate(Predicate<? super T> predicate1,
Predicate<? super T> predicate2)
Constructor that performs no validation.
|
Modifier and Type | Method and Description |
---|---|
static <T> Predicate<T> |
andPredicate(Predicate<? super T> predicate1,
Predicate<? super T> predicate2)
Factory to create the predicate.
|
boolean |
evaluate(T object)
Evaluates the predicate returning true if both predicates return true.
|
Predicate<? super T>[] |
getPredicates()
Gets the two predicates being decorated as an array.
|
public AndPredicate(Predicate<? super T> predicate1, Predicate<? super T> predicate2)
andPredicate
if you want that.predicate1
- the first predicate to check, not nullpredicate2
- the second predicate to check, not nullpublic static <T> Predicate<T> andPredicate(Predicate<? super T> predicate1, Predicate<? super T> predicate2)
T
- the type that the predicate queriespredicate1
- the first predicate to check, not nullpredicate2
- the second predicate to check, not nulland
predicateNullPointerException
- if either predicate is nullpublic boolean evaluate(T object)
public Predicate<? super T>[] getPredicates()
getPredicates
in interface PredicateDecorator<T>
Copyright © 2001–2018 The Apache Software Foundation. All rights reserved.