org.apache.commons.collections.functors
Class MapTransformer
java.lang.Objectorg.apache.commons.collections.functors.MapTransformer
- Serializable, Transformer
public final class MapTransformer
extends java.lang.Object
Transformer implementation that returns the value held in a specified map
using the input parameter as a key.
$Revision: 646777 $ $Date: 2008-04-10 13:33:15 +0100 (Thu, 10 Apr 2008) $static Transformer | getInstance(Map map)- Factory to create the transformer.
|
Map | getMap()- Gets the map to lookup in.
|
Object | transform(Object input)- Transforms the input to result by looking it up in a
Map.
|
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
getMap
public Map getMap()
Gets the map to lookup in.
transform
public Object transform(Object input)
Transforms the input to result by looking it up in a Map.
- transform in interface Transformer
input - the input object to transform
Copyright © 2001-2008 Apache Software Foundation. All Rights Reserved.