Class PredicateTransformer<T>
java.lang.Object
org.apache.commons.collections4.functors.PredicateTransformer<T>
- Type Parameters:
T- the type of the input and result to the function.
- All Implemented Interfaces:
Serializable,Function<T,,Boolean> Transformer<T,Boolean>
Transformer implementation that calls a Predicate using the input object
and then returns the result.
- Since:
- 3.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPredicateTransformer(Predicate<? super T> predicate) Constructor that performs no validation. -
Method Summary
Modifier and TypeMethodDescriptionGets the predicate.static <T> Transformer<T, Boolean> predicateTransformer(Predicate<? super T> predicate) Factory method that performs validation.Transforms the input to result by calling a predicate.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.commons.collections4.Transformer
apply
-
Constructor Details
-
PredicateTransformer
Constructor that performs no validation. UsepredicateTransformerif you want that.- Parameters:
predicate- the predicate to call, not null
-
-
Method Details
-
predicateTransformer
Factory method that performs validation.- Type Parameters:
T- the input type- Parameters:
predicate- the predicate to call, not null- Returns:
- the
predicatetransformer - Throws:
IllegalArgumentException- if the predicate is null
-
getPredicate
-
transform
-