public class MultivaluedMapImpl<K,V> extends HashMap<K,List<V>> implements MultivaluedMap<K,V>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
MultivaluedMapImpl() |
Modifier and Type | Method and Description |
---|---|
void |
add(K key,
V value)
Add a value to the current list of values for the supplied key.
|
void |
addAll(K key,
List<V> valueList)
Add all the values from the supplied value list to the current list of
values for the supplied key.
|
void |
addAll(K key,
V... newValues)
Add multiple values to the current list of values for the supplied key.
|
void |
addAll(MultivaluedMapImpl<K,V> other) |
void |
addFirst(K key,
V value)
Add a value to the first position in the current list of values for the
supplied key.
|
void |
addMultiple(K key,
Collection<V> values) |
boolean |
equalsIgnoreValueOrder(MultivaluedMap<K,V> omap)
Compare the specified map with this map for equality modulo the order
of values for each key.
|
V |
getFirst(K key)
A shortcut to get the first value of the supplied key.
|
List<V> |
getList(K key) |
void |
putSingle(K key,
V value)
Set the key's value to be a one item list consisting of the supplied value.
|
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
equals, hashCode, toString
public void putSingle(K key, V value)
MultivaluedMap
putSingle
in interface MultivaluedMap<K,V>
key
- the keyvalue
- the single value of the keypublic void addAll(K key, V... newValues)
MultivaluedMap
NullPointerException
if the supplied array of values
is null
.addAll
in interface MultivaluedMap<K,V>
key
- the key.newValues
- the values to be added.public void addAll(K key, List<V> valueList)
MultivaluedMap
NullPointerException
if the
supplied array of values is null
.addAll
in interface MultivaluedMap<K,V>
key
- the key.valueList
- the list of values to be added.public void addFirst(K key, V value)
MultivaluedMap
addFirst
in interface MultivaluedMap<K,V>
key
- the keyvalue
- the value to be added.public final void add(K key, V value)
MultivaluedMap
add
in interface MultivaluedMap<K,V>
key
- the keyvalue
- the value to be added.public final void addMultiple(K key, Collection<V> values)
public V getFirst(K key)
MultivaluedMap
getFirst
in interface MultivaluedMap<K,V>
key
- the keypublic void addAll(MultivaluedMapImpl<K,V> other)
public boolean equalsIgnoreValueOrder(MultivaluedMap<K,V> omap)
MultivaluedMap
equalsIgnoreValueOrder
in interface MultivaluedMap<K,V>
omap
- map to be compared to this one.Copyright © 2013. All Rights Reserved.