Class CompositeMap<K,V>

java.lang.Object
java.util.AbstractMap<K,V>
com.atlassian.jira.util.collect.CompositeMap<K,V>
All Implemented Interfaces:
Map<K,V>

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

Restrictions:

  • The supplied maps become the property of the new map. They should not be accessed directly in any way after the composite map is created. The result of such access is left undefined.
  • The mutability of this map depends on that of the first map. For efficiency reasons, this class uses the first map to hold updated state. If the first map is immutable, then this map will be, too. The second map in never modified by this class.
  • 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 undefined manner if accessed by concurrent threads without synchronization.