Class AndPredicate<T>
java.lang.Object
org.apache.commons.collections4.functors.AbstractPredicate<T>
org.apache.commons.collections4.functors.AndPredicate<T>
- Type Parameters:
- T- the type of the input to the predicate.
- All Implemented Interfaces:
- Serializable,- Predicate<T>,- PredicateDecorator<T>,- Predicate<T>
public final class AndPredicate<T>
extends AbstractPredicate<T>
implements PredicateDecorator<T>, Serializable
Predicate implementation that returns true if both the predicates return true.
- Since:
- 3.0
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionAndPredicate(Predicate<? super T> predicate1, Predicate<? super T> predicate2) Constructor that performs no validation.
- 
Method SummaryModifier and TypeMethodDescriptionstatic <T> Predicate<T> andPredicate(Predicate<? super T> predicate1, Predicate<? super T> predicate2) Creates the predicate.Gets the two predicates being decorated as an array.booleanEvaluates the predicate returning true if both predicates return true.Methods inherited from class org.apache.commons.collections4.functors.AbstractPredicateevaluate
- 
Constructor Details- 
AndPredicateConstructor that performs no validation. UseandPredicateif you want that.- Parameters:
- predicate1- the first predicate to check, not null
- predicate2- the second predicate to check, not null
 
 
- 
- 
Method Details- 
andPredicatepublic static <T> Predicate<T> andPredicate(Predicate<? super T> predicate1, Predicate<? super T> predicate2) Creates the predicate.- Type Parameters:
- T- the type that the predicate queries
- Parameters:
- predicate1- the first predicate to check, not null
- predicate2- the second predicate to check, not null
- Returns:
- the andpredicate
- Throws:
- NullPointerException- if either predicate is null
 
- 
getPredicatesGets the two predicates being decorated as an array.- Specified by:
- getPredicatesin interface- PredicateDecorator<T>
- Returns:
- the predicates
- Since:
- 3.1
 
- 
test
 
-