public final class TransformerPredicate<T> extends Object implements Predicate<T>, Serializable
Constructor and Description |
---|
TransformerPredicate(Transformer<? super T,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,Boolean> |
getTransformer()
Gets the transformer.
|
static <T> Predicate<T> |
transformerPredicate(Transformer<? super T,Boolean> transformer)
Factory to create the predicate.
|
public TransformerPredicate(Transformer<? super T,Boolean> transformer)
transformerPredicate
if you want that.transformer
- the transformer to decoratepublic static <T> Predicate<T> transformerPredicate(Transformer<? super T,Boolean> transformer)
T
- the type that the predicate queriestransformer
- the transformer to decorateNullPointerException
- 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,Boolean> getTransformer()
Copyright © 2001–2018 The Apache Software Foundation. All rights reserved.