Class CompositeMap<K,​V>

  • All Implemented Interfaces:
    Map<K,​V>

    @NotThreadSafe
    public class CompositeMap<K,​V>
    extends AbstractMap<K,​V>
    implements Map<K,​V>
    Provides a union view of two maps.

    Changes made to this map will only be made on the first map.

    Note that CompositeMap 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 will behave in an unspecified manner if accessed by concurrent threads without synchronization.