Class AndPredicate<T>
- java.lang.Object
 - 
- org.apache.commons.collections4.functors.AndPredicate<T>
 
 
- 
- All Implemented Interfaces:
 java.io.Serializable,PredicateDecorator<T>,Predicate<T>
public final class AndPredicate<T> extends java.lang.Object implements PredicateDecorator<T>, java.io.Serializable
Predicate implementation that returns true if both the predicates return true.- Since:
 - 3.0
 - See Also:
 - Serialized Form
 
 
- 
- 
Constructor Summary
Constructors Constructor Description AndPredicate(Predicate<? super T> predicate1, Predicate<? super T> predicate2)Constructor that performs no validation. 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> Predicate<T>andPredicate(Predicate<? super T> predicate1, Predicate<? super T> predicate2)Factory to create the predicate.booleanevaluate(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. 
 - 
 
- 
- 
Method Detail
- 
andPredicate
public static <T> Predicate<T> andPredicate(Predicate<? super T> predicate1, Predicate<? super T> predicate2)
Factory to create the predicate.- Type Parameters:
 T- the type that the predicate queries- Parameters:
 predicate1- the first predicate to check, not nullpredicate2- the second predicate to check, not null- Returns:
 - the 
andpredicate - Throws:
 java.lang.NullPointerException- if either predicate is null
 
- 
evaluate
public boolean evaluate(T object)
Evaluates the predicate returning true if both predicates return true. 
- 
getPredicates
public Predicate<? super T>[] getPredicates()
Gets the two predicates being decorated as an array.- Specified by:
 getPredicatesin interfacePredicateDecorator<T>- Returns:
 - the predicates
 - Since:
 - 3.1
 
 
 - 
 
 -