| Modifier and Type | Field and Description |
|---|---|
| private final Transformer | iFalseTransformer
The transformer to use if false |
| private final Predicate | iPredicate
The test |
| private final Transformer | iTrueTransformer
The transformer to use if true |
| private static final long | serialVersionUID
Serial version UID |
| Access | Constructor and Description |
|---|---|
| public | IfTransformer(final Predicate<? super I>
predicate to switch on, not null predicate, final Transformer<? super I, ? extends O> transformer used if true, not null trueTransformer, final Transformer<? super I, ? extends O> transformer used if false, not null falseTransformer)Constructor that performs no validation. |
| Modifier and Type | Method and Description |
|---|---|
| public Transformer | |
| public Predicate | |
| public Transformer | |
| public static < input type for the transformer I, output type for the transformer O> Transformer | Returns: theif transformerpredicate to switch on predicate, final Transformer<? super I, ? extends O> transformer used if true trueTransformer, final Transformer<? super I, ? extends O> transformer used if false falseTransformer)Factory method that performs validation. |
| public static < input and output type for the transformer T> Transformer | Returns: theif transformerpredicate to switch on predicate, final Transformer<? super T, ? extends T> transformer used if true trueTransformer)Factory method that performs validation. |
| public O | Returns: the transformed resultthe input object to transform input)Implements org. |
| iFalseTransformer | back to summary |
|---|---|
| private final Transformer<? super I, ? extends O> iFalseTransformer The transformer to use if false | |
| iPredicate | back to summary |
|---|---|
| private final Predicate<? super I> iPredicate The test | |
| iTrueTransformer | back to summary |
|---|---|
| private final Transformer<? super I, ? extends O> iTrueTransformer The transformer to use if true | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Serial version UID | |
| IfTransformer | back to summary |
|---|---|
| public IfTransformer(final Predicate<? super I> predicate, final Transformer<? super I, ? extends O> trueTransformer, final Transformer<? super I, ? extends O> falseTransformer) Constructor that performs no validation.
Use the static factory method
| |
| getFalseTransformer | back to summary |
|---|---|
| public Transformer Gets the transformer used when false.
| |
| getPredicate | back to summary |
|---|---|
| public Predicate Gets the predicate.
| |
| getTrueTransformer | back to summary |
|---|---|
| public Transformer Gets the transformer used when true.
| |
| ifTransformer | back to summary |
|---|---|
| public static <I, O> Transformer Factory method that performs validation.
| |
| ifTransformer | back to summary |
|---|---|
| public static <T> Transformer Factory method that performs validation. This factory creates a transformer that just returns the input object when the predicate is false.
| |
| transform | back to summary |
|---|---|
| public O transform(final I input) Implements org. Transforms the input using the true or false transformer based to the result of the predicate.
| |