public interface TransformerArray<FROM,TO> extends Transformer<FROM,TO>
A transformer that uses an array of transformers for transformation, first transformer that does something matches.
| Modifier and Type | Method and Description |
|---|---|
default TO |
apply(FROM f) |
static <FROM,TO> TransformerArray<FROM,TO> |
create(Transformer<FROM,TO>[] transformers)
Creates a new transformer array.
|
Transformer<FROM,TO>[] |
getTransformers()
Returns the array of transformers used for transformations.
|
default TO |
transform(FROM from)
Transforms from one representation to another using an array of potential transformers.
|
transformTransformer<FROM,TO>[] getTransformers()
Returns the array of transformers used for transformations.
default TO transform(FROM from)
Transforms from one representation to another using an array of potential transformers. The first transformer that does not throw an exception and that does not return null will be used. Last resort, if no transformer provides the new transformation, is to throw an exception.
transform in interface Transformer<FROM,TO>from - input representationNullPointerException - if an argument was nullIllegalArgumentException - if an argument had null elements or if no transformer could perform a non-null transformationstatic <FROM,TO> TransformerArray<FROM,TO> create(Transformer<FROM,TO>[] transformers)
Creates a new transformer array.
FROM - type of the source (from)TO - type of the target (to)transformers - the array of transformersNullPointerException - if the argument was null or had any null elementCopyright © 2016–2017. All rights reserved.