Class TransformedMap

  • All Implemented Interfaces:
    Serializable, Map
    Direct Known Subclasses:

    public class TransformedMap
    extends AbstractMapDecorator
    implements Serializable
    Commons Collections 3 is in maintenance mode. Commons Collections 4 should be used instead.
    Decorates another Map to transform objects that are added.

    The Map put methods and Map.Entry setValue method are affected by this class. Thus objects must be removed or searched for using their transformed form. For example, if the transformation converts Strings to Integers, you must use the Integer form to remove objects.

    Note that TransformedMap is not synchronized and is not thread-safe. If you wish to use this map from multiple threads concurrently, you must use appropriate synchronization. The simplest approach is to wrap this map using Collections.synchronizedMap(Map). This class may throw exceptions when accessed by concurrent threads without synchronization.

    This class is Serializable from Commons Collections 3.1.

    Commons Collections 3.0
    See Also:
    Serialized Form