public final class TransformerPredicate<T> extends java.lang.Object implements Predicate<T>, java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
private Transformer<? super T,java.lang.Boolean> |
iTransformer
The transformer to call
|
private static long |
serialVersionUID
Serial version UID
|
| Constructor and Description |
|---|
TransformerPredicate(Transformer<? super T,java.lang.Boolean> transformer)
Constructor that performs no validation.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
evaluate(T object)
Evaluates the predicate returning the result of the decorated transformer.
|
Transformer<? super T,java.lang.Boolean> |
getTransformer()
Gets the transformer.
|
static <T> Predicate<T> |
transformerPredicate(Transformer<? super T,java.lang.Boolean> transformer)
Factory to create the predicate.
|
private static final long serialVersionUID
private final Transformer<? super T,java.lang.Boolean> iTransformer
public TransformerPredicate(Transformer<? super T,java.lang.Boolean> transformer)
transformerPredicate if you want that.transformer - the transformer to decoratepublic static <T> Predicate<T> transformerPredicate(Transformer<? super T,java.lang.Boolean> transformer)
T - the type that the predicate queriestransformer - the transformer to decoratejava.lang.IllegalArgumentException - if the transformer is nullpublic boolean evaluate(T object)
evaluate in interface Predicate<T>object - the input objectFunctorException - if the transformer returns an invalid typepublic Transformer<? super T,java.lang.Boolean> getTransformer()