org.apache.commons.collections.functors
Class MapTransformer
java.lang.Object
|
+--org.apache.commons.collections.functors.MapTransformer
All Implemented Interfaces:
Transformer, Serializable
public final class
MapTransformerextends java.lang.Object
implements
Transformer, Serializable
Transformer implementation that returns the value held in a specified map
using the input parameter as a key.
- Commons Collections 3.0
- Stephen Colebourne
getInstance
public static Transformer getInstance(Map map)
Factory to create the transformer.
If the map is null, a transformer that always returns null is returned.
- map - the map, not cloned
- the transformer
transform
public Object transform(Object input)
Returns the result by looking up in the map.
- input