Package org.restlet.util
Class WrapperMap<K,V>
java.lang.Object
org.restlet.util.WrapperMap<K,V>
- All Implemented Interfaces:
Map<K,V>
Map wrapper. Modifiable map that delegates all methods to a wrapped map. This
allows an easy subclassing.
- Author:
- Jerome Louvel
- See Also:
-
Nested Class Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Removes all mappings from this Map.booleancontainsKey(Object key) Returns true if this map contains a mapping for the specified key.booleancontainsValue(Object value) Returns true if this map maps one or more keys to the specified value.entrySet()Returns a set view of the mappings contained in this map.booleanCompares the specified object with this map for equality.Returns the value to which this map maps the specified key.Returns the delegate list.inthashCode()Returns the hash code value for this map.booleanisEmpty()Returns true if this map contains no key-value mappings.keySet()Returns a set view of the keys contained in this map.Associates the specified value with the specified key in this map (optional operation).voidCopies all of the mappings from the specified map to this map (optional operation).Removes the mapping for this key from this map if it is present (optional operation).intsize()Returns the number of key-value mappings in this map.values()Returns a collection view of the values contained in this map.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
WrapperMap
public WrapperMap()Constructor. -
WrapperMap
Constructor.- Parameters:
delegate- The delegate list.
-
-
Method Details
-
clear
public void clear()Removes all mappings from this Map. -
containsKey
Returns true if this map contains a mapping for the specified key.- Specified by:
containsKeyin interfaceMap<K,V> - Parameters:
key- The key to look up.- Returns:
- True if this map contains a mapping for the specified key.
-
containsValue
Returns true if this map maps one or more keys to the specified value.- Specified by:
containsValuein interfaceMap<K,V> - Parameters:
value- The value to look up- Returns:
- True if this map maps one or more keys to the specified value.
-
entrySet
Returns a set view of the mappings contained in this map. -
equals
Compares the specified object with this map for equality. -
get
Returns the value to which this map maps the specified key. -
getDelegate
Returns the delegate list.- Returns:
- The delegate list.
-
hashCode
public int hashCode()Returns the hash code value for this map. -
isEmpty
public boolean isEmpty()Returns true if this map contains no key-value mappings. -
keySet
Returns a set view of the keys contained in this map. -
put
Associates the specified value with the specified key in this map (optional operation).- Specified by:
putin interfaceMap<K,V> - Parameters:
key- Key with which the specified value is to be associated.value- Value to be associated with the specified key.- Returns:
- The previous value associated with specified key, or null if there was no mapping for key. A null return can also indicate that the map previously associated null with the specified key, if the implementation supports null values.
-
putAll
Copies all of the mappings from the specified map to this map (optional operation). -
remove
Removes the mapping for this key from this map if it is present (optional operation). -
size
public int size()Returns the number of key-value mappings in this map. -
values
Returns a collection view of the values contained in this map.
-