Class MapTransformer<I,O>
java.lang.Object
org.apache.commons.collections4.functors.MapTransformer<I,O>
- All Implemented Interfaces:
Serializable, Transformer<I,O>
Transformer implementation that returns the value held in a specified map
using the input parameter as a key.
- Since:
- 3.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe map of data to lookup inprivate static final longSerial version UID -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateMapTransformer(Map<? super I, ? extends O> map) Constructor that performs no validation. -
Method Summary
Modifier and TypeMethodDescriptiongetMap()Gets the map to lookup in.static <I,O> Transformer <I, O> mapTransformer(Map<? super I, ? extends O> map) Factory to create the transformer.Transforms the input to result by looking it up in aMap.
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerial version UID- See Also:
-
iMap
-
-
Constructor Details
-
MapTransformer
-
-
Method Details
-
mapTransformer
Factory to create the transformer.If the map is null, a transformer that always returns null is returned.
- Type Parameters:
I- the input typeO- the output type- Parameters:
map- the map, not cloned- Returns:
- the transformer
-
transform
-
getMap
-