Class CompositeMap<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
com.atlassian.confluence.util.collections.CompositeMap<K,V>
- All Implemented Interfaces:
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Method Summary
Methods inherited from class java.util.AbstractMap
clear, clone, containsValue, equals, hashCode, putAll, size, toString, values
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsValue, equals, forEach, getOrDefault, hashCode, merge, putAll, putIfAbsent, remove, replace, replace, replaceAll, size, values
-
Method Details
-
of
Create a new CompositeMap with two composited Map instances.- Parameters:
one
- the first Map to be composited, values here override values in the second.two
- the second Map to be composited- Returns:
- the CompositeMap
- Throws:
IllegalArgumentException
- if there is a key collision
-
entrySet
-
get
-
keySet
-
containsKey
- Specified by:
containsKey
in interfaceMap<K,
V> - Overrides:
containsKey
in classAbstractMap<K,
V>
-
isEmpty
public boolean isEmpty() -
put
-
remove
-