Class TransformedPredicate<T>
java.lang.Object
org.apache.commons.collections4.functors.AbstractPredicate<T>
org.apache.commons.collections4.functors.TransformedPredicate<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 TransformedPredicate<T>
extends AbstractPredicate<T>
implements PredicateDecorator<T>, Serializable
Predicate implementation that transforms the given object before invoking
 another 
Predicate.- Since:
- 3.1
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionTransformedPredicate(Transformer<? super T, ? extends T> transformer, Predicate<? super T> predicate) Constructor that performs no validation.
- 
Method SummaryModifier and TypeMethodDescriptionGets the predicate being decorated.Transformer<? super T, ? extends T> Gets the transformer in use.booleanEvaluates the predicate returning the result of the decorated predicate once the input has been transformedstatic <T> Predicate<T> transformedPredicate(Transformer<? super T, ? extends T> transformer, Predicate<? super T> predicate) Creates the predicate.Methods inherited from class org.apache.commons.collections4.functors.AbstractPredicateevaluate
- 
Constructor Details- 
TransformedPredicatepublic TransformedPredicate(Transformer<? super T, ? extends T> transformer, Predicate<? super T> predicate) Constructor that performs no validation. UsetransformedPredicateif you want that.- Parameters:
- transformer- the transformer to use
- predicate- the predicate to decorate
 
 
- 
- 
Method Details- 
transformedPredicatepublic static <T> Predicate<T> transformedPredicate(Transformer<? super T, ? extends T> transformer, Predicate<? super T> predicate) Creates the predicate.- Type Parameters:
- T- the type that the predicate queries
- Parameters:
- transformer- the transformer to call
- predicate- the predicate to call with the result of the transform
- Returns:
- the predicate
- Throws:
- NullPointerException- if the transformer or the predicate is null
 
- 
getPredicatesGets the predicate being decorated.- Specified by:
- getPredicatesin interface- PredicateDecorator<T>
- Returns:
- the predicate as the only element in an array
- Since:
- 3.1
 
- 
getTransformerGets the transformer in use.- Returns:
- the transformer
 
- 
testEvaluates the predicate returning the result of the decorated predicate once the input has been transformed
 
-