Package com.identityworksllc.iiq.common
Interface DelegatedMap<K,V>
-
- Type Parameters:
K- The key typeV- The value type
- All Superinterfaces:
Map<K,V>
- All Known Subinterfaces:
DelegatedConcurrentMap<K,V>
- All Known Implementing Classes:
TempStorage,ThreadStorage,TypeFriendlyDelegatedConcurrentMap,TypeFriendlyDelegatedMap
public interface DelegatedMap<K,V> extends Map<K,V>
A Map interface that delegates all calls by default to the contained Map.This is useful for situations where the implementation of the Map is the new behavior, not the implementation of the individual methods.
The delegate Map is whatever is returned from
getDelegate().
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidclear()Removes all mappings from the mapdefault booleancontainsKey(Object key)Returns true if this map contains a mapping for the specified key.default booleancontainsValue(Object value)Returns true if this map maps one or more keys to the specified value.default Set<Map.Entry<K,V>>entrySet()Returns aSetview of the mappings contained in this map.default Vget(Object key)Gets the value to which the specified key is mapped.Map<K,V>getDelegate()Gets the map to which all otherMapcalls are delegateddefault booleanisEmpty()Returns true if this map contains no key-value mappings.default Set<K>keySet()Returns aSetview of the keys contained in this map.default Vput(K key, V value)default voidputAll(Map<? extends K,? extends V> m)Copies all of the mappings from the specified map to this map.default Vremove(Object key)Removes the mapping for a key from this map if it is present.default intsize()Returns the number of key-value mappings in this map.default Collection<V>values()Returns aCollectionview of the values contained in this map.-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Method Detail
-
clear
default void clear()
Removes all mappings from the map- Specified by:
clearin interfaceMap<K,V>- See Also:
Map.clear()
-
containsKey
default boolean containsKey(Object key)
Returns true if this map contains a mapping for the specified key.- Specified by:
containsKeyin interfaceMap<K,V>- Parameters:
key- key whose presence in this map is to be tested- Returns:
- true if this map contains a mapping for the specified key
- See Also:
Map.containsKey(Object)
-
containsValue
default boolean containsValue(Object value)
Returns true if this map maps one or more keys to the specified value.- Specified by:
containsValuein interfaceMap<K,V>- Parameters:
value- value whose presence in this map is to be tested- Returns:
- true if this map maps one or more keys to the specified value
- See Also:
Map.containsValue(Object)
-
entrySet
default Set<Map.Entry<K,V>> entrySet()
Returns aSetview of the mappings contained in this map.- Specified by:
entrySetin interfaceMap<K,V>- Returns:
- a set view of the mappings contained in this map
- See Also:
Map.entrySet()
-
get
default V get(Object key)
Gets the value to which the specified key is mapped.The underlying Map will determine the behavior if there is no key.
- Specified by:
getin interfaceMap<K,V>- Parameters:
key- the key whose associated value is to be returned- Returns:
- the value to which the specified key is mapped, or null if this map contains no mapping for the key
- See Also:
Map.get(Object)
-
getDelegate
Map<K,V> getDelegate()
Gets the map to which all otherMapcalls are delegated- Returns:
- The Map to which all calls are delegated
-
isEmpty
default boolean isEmpty()
Returns true if this map contains no key-value mappings.
-
keySet
default Set<K> keySet()
Returns aSetview of the keys contained in this map.The behavior of the
Setis determined by the underlying Map.- Specified by:
keySetin interfaceMap<K,V>- Returns:
- a set view of the keys contained in this map
- See Also:
Map.keySet()
-
putAll
default void putAll(Map<? extends K,? extends V> m)
Copies all of the mappings from the specified map to this map.- Specified by:
putAllin interfaceMap<K,V>- Parameters:
m- mappings to be stored in this map- See Also:
Map.putAll(Map)
-
size
default int size()
Returns the number of key-value mappings in this map.- Specified by:
sizein interfaceMap<K,V>- Returns:
- the number of key-value mappings in this map
- See Also:
Map.size()
-
values
default Collection<V> values()
Returns aCollectionview of the values contained in this map.
-
-