public final class MapTransformer<I,O> extends Objectimplements Transformer <I ,O>, Serializable
| Modifier and Type | Method and Description |
|---|---|
Map |
getMap()
Gets the map to lookup in.
|
static <I |
mapTransformer(Map
Factory to create the transformer.
|
O |
transform(I input)
Transforms the input to result by looking it up in a
Map.
|
public static <I,O> Transformer <I ,O> mapTransformer(Map <? super I ,? extends O> map)
If the map is null, a transformer that always returns null is returned.
I - the input type
O - the output type
map - the map, not cloned
public O transform(I input)
Map.
transform in interface
Transformer<I,O>
input - the input object to transform