public class PredicateTransformer extends java.lang.Object implements Transformer, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
private Predicate |
iPredicate
The closure to wrap
|
private static long |
serialVersionUID
Serial version UID
|
Constructor and Description |
---|
PredicateTransformer(Predicate predicate)
Constructor that performs no validation.
|
Modifier and Type | Method and Description |
---|---|
static Transformer |
getInstance(Predicate predicate)
Factory method that performs validation.
|
Predicate |
getPredicate()
Gets the predicate.
|
java.lang.Object |
transform(java.lang.Object input)
Transforms the input to result by calling a predicate.
|
private static final long serialVersionUID
private final Predicate iPredicate
public PredicateTransformer(Predicate predicate)
getInstance
if you want that.predicate
- the predicate to call, not nullpublic static Transformer getInstance(Predicate predicate)
predicate
- the predicate to call, not nullpredicate
transformerjava.lang.IllegalArgumentException
- if the predicate is nullpublic java.lang.Object transform(java.lang.Object input)
transform
in interface Transformer
input
- the input object to transformpublic Predicate getPredicate()