net.sf.molae.pipe.filter
Class TransformedFilter<S,T>
java.lang.Object
net.sf.molae.pipe.filter.TransformedFilter<S,T>
- All Implemented Interfaces:
- TypedPredicate<T>
public final class TransformedFilter<S,T>
- extends Object
- implements TypedPredicate<T>
Calls a transformer before calling the predicate.
Method Summary |
boolean |
evaluate(T input)
Returns the evaluation of the transformed input. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TransformedFilter
public TransformedFilter(TypedPredicate<S> predicate,
TwoWayTransformer<? super T,? extends S> transformer)
- Constructs a TransformedFilter object.
- Parameters:
predicate
- base predicatetransformer
- base transformer
- Throws:
NullPointerException
- if the specified objects are
null
.
evaluate
public boolean evaluate(T input)
- Returns the evaluation of the transformed input.
Performs two steps:
- It transforms the input with the underlying transformer,
- then it evaluates the transformed input by the underlying
predicate.
- Specified by:
evaluate
in interface TypedPredicate<T>
- Parameters:
input
- object to evaluate.
- Returns:
- the evaluation of the transformed input.