Class MapTransformer

  • All Implemented Interfaces:
    Serializable, Transformer

    @Deprecated(since="2021-04-30")
    public final class MapTransformer
    extends Object
    implements Transformer, Serializable
    Deprecated.
    Commons Collections 3 is in maintenance mode. Commons Collections 4 should be used instead.
    Transformer implementation that returns the value held in a specified map using the input parameter as a key.
    Since:
    Commons Collections 3.0
    See Also:
    Serialized Form
    • Method Detail

      • getInstance

        public static Transformer getInstance​(Map map)
        Deprecated.
        Factory to create the transformer.

        If the map is null, a transformer that always returns null is returned.

        Parameters:
        map - the map, not cloned
        Returns:
        the transformer
      • transform

        public Object transform​(Object input)
        Deprecated.
        Transforms the input to result by looking it up in a Map.
        Specified by:
        transform in interface Transformer
        Parameters:
        input - the input object to transform
        Returns:
        the transformed result
      • getMap

        public Map getMap()
        Deprecated.
        Gets the map to lookup in.
        Returns:
        the map
        Since:
        Commons Collections 3.1