Class ForwardingMap<K,V>
- All Implemented Interfaces:
Map<K,V>
- Direct Known Subclasses:
EnumBiMap,EnumHashBiMap,ForwardingConcurrentMap,ForwardingSortedMap,ImmutableClassToInstanceMap,ImmutableTypeToInstanceMap,MutableClassToInstanceMap,MutableTypeToInstanceMap
Warning: The methods of ForwardingMap forward
indiscriminately to the methods of the delegate. For example,
overriding put(K, V) alone will not change the behavior of putAll(java.util.Map<? extends K, ? extends V>), which can lead to unexpected behavior. In this case, you should
override putAll as well, either providing your own implementation, or
delegating to the provided standardPutAll method.
Each of the standard methods, where appropriate, use Objects.equal(java.lang.Object, java.lang.Object) to test equality for both keys and values. This may not be
the desired behavior for map implementations that use non-standard notions of
key equality, such as a SortedMap whose comparator is not consistent
with equals.
The standard methods and the collection views they return are not
guaranteed to be thread-safe, even when all of the methods that they depend
on are thread-safe.
- Since:
- 2.0 (imported from Google Collections Library)
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Deprecated.booleancontainsKey(Object key) Deprecated.booleancontainsValue(Object value) Deprecated.entrySet()Deprecated.booleanDeprecated.Deprecated.inthashCode()Deprecated.booleanisEmpty()Deprecated.keySet()Deprecated.Deprecated.voidDeprecated.Deprecated.intsize()Deprecated.values()Deprecated.Methods inherited from class com.google.common.collect.ForwardingObject
toStringMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Method Details
-
size
public int size()Deprecated. -
isEmpty
public boolean isEmpty()Deprecated. -
remove
Deprecated. -
clear
public void clear()Deprecated. -
containsKey
Deprecated.- Specified by:
containsKeyin interfaceMap<K,V>
-
containsValue
Deprecated.- Specified by:
containsValuein interfaceMap<K,V>
-
get
Deprecated. -
put
Deprecated. -
putAll
Deprecated. -
keySet
Deprecated. -
values
Deprecated. -
entrySet
Deprecated. -
equals
Deprecated. -
hashCode
public int hashCode()Deprecated.
-