@GwtCompatible public abstract class ForwardingMap<K,V> extends ForwardingObject implements Map<K,V>
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.
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<K,V>> |
entrySet() |
boolean |
equals(Object object) |
V |
get(Object key) |
int |
hashCode() |
boolean |
isEmpty() |
Set<K> |
keySet() |
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> map) |
V |
remove(Object object) |
int |
size() |
Collection<V> |
values() |
toString
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public boolean containsKey(@Nullable Object key)
containsKey
in interface Map<K,V>
public boolean containsValue(@Nullable Object value)
containsValue
in interface Map<K,V>
Copyright © 2010 - 2020 Adobe. All Rights Reserved