public final class MapTransformer extends java.lang.Object implements Transformer, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
private java.util.Map |
iMap
The map of data to lookup in
|
private static long |
serialVersionUID
Serial version UID
|
Modifier | Constructor and Description |
---|---|
private |
MapTransformer(java.util.Map map)
Constructor that performs no validation.
|
Modifier and Type | Method and Description |
---|---|
static Transformer |
getInstance(java.util.Map map)
Factory to create the transformer.
|
java.util.Map |
getMap()
Gets the map to lookup in.
|
java.lang.Object |
transform(java.lang.Object input)
Transforms the input to result by looking it up in a
Map . |
private static final long serialVersionUID
private final java.util.Map iMap
private MapTransformer(java.util.Map map)
getInstance
if you want that.map
- the map to use for lookup, not clonedpublic static Transformer getInstance(java.util.Map map)
If the map is null, a transformer that always returns null is returned.
map
- the map, not clonedpublic java.lang.Object transform(java.lang.Object input)
Map
.transform
in interface Transformer
input
- the input object to transformpublic java.util.Map getMap()