public class ChainedTransformer<T> extends Objectimplements Transformer <T ,T>, Serializable
The input object is passed to the first transformer. The transformed result is passed to the second transformer and so on.
| Constructor and Description |
|---|
ChainedTransformer(Transformer
Constructor that performs no validation.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> Transformer |
chainedTransformer(Collection
Create a new Transformer that calls each transformer in turn, passing the result into the next transformer.
|
static <T> Transformer |
chainedTransformer(Transformer
Factory method that performs validation and copies the parameter array.
|
Transformer |
getTransformers()
Gets the transformers.
|
T |
transform(T object)
Transforms the input to result via each decorated transformer
|
public ChainedTransformer(Transformer<? super T ,? extends T>... transformers)
chainedTransformer if you want that.
transformers - the transformers to chain, copied, no nulls
public static <T> Transformer<T ,T> chainedTransformer(Transformer <? super T ,? extends T>... transformers)
T - the object type
transformers - the transformers to chain, copied, no nulls
chained transformer
NullPointerException - if the transformers array is null
NullPointerException - if any transformer in the array is null
public static <T> Transformer<T ,T> chainedTransformer(Collection <? extends Transformer <? super T ,? extends T>> transformers)
T - the object type
transformers - a collection of transformers to chain
chained transformer
NullPointerException - if the transformers collection is null
NullPointerException - if any transformer in the collection is null
public T transform(T object)
transform in interface
Transformer<T,T>
object - the input object passed to the first transformer
public Transformer<? super T ,? extends T>[] getTransformers()