K - the keyV - the valuepublic class ImmutableMultivaluedMap<K,V> extends Object implements MultivaluedMap<K,V>
MultivaluedMap.| Constructor and Description |
|---|
ImmutableMultivaluedMap(MultivaluedMap<K,V> delegate)
Creates a new ImmutableMultivaluedMap.
|
| 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 |
addFirst(K key,
V value)
Add a value to the first position in the current list of values for the
supplied key.
|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
static <K,V> ImmutableMultivaluedMap<K,V> |
empty()
Returns an empty immutable map.
|
Set<Map.Entry<K,List<V>>> |
entrySet() |
boolean |
equalsIgnoreValueOrder(MultivaluedMap<K,V> otherMap)
Compare the specified map with this map for equality modulo the order
of values for each key.
|
List<V> |
get(Object key) |
V |
getFirst(K key)
A shortcut to get the first value of the supplied key.
|
boolean |
isEmpty() |
Set<K> |
keySet() |
List<V> |
put(K key,
List<V> value) |
void |
putAll(Map<? extends K,? extends List<V>> m) |
void |
putSingle(K key,
V value)
Set the key's value to be a one item list consisting of the supplied value.
|
List<V> |
remove(Object key) |
int |
size() |
Collection<List<V>> |
values() |
public ImmutableMultivaluedMap(MultivaluedMap<K,V> delegate)
delegate - the underlying MultivaluedMappublic static <K,V> ImmutableMultivaluedMap<K,V> empty()
public boolean equalsIgnoreValueOrder(MultivaluedMap<K,V> otherMap)
MultivaluedMapequalsIgnoreValueOrder in interface MultivaluedMap<K,V>otherMap - map to be compared to this one.public void putSingle(K key, V value)
MultivaluedMapputSingle in interface MultivaluedMap<K,V>key - the keyvalue - the single value of the keypublic void add(K key, V value)
MultivaluedMapadd in interface MultivaluedMap<K,V>key - the keyvalue - the value to be added.public V getFirst(K key)
MultivaluedMapgetFirst in interface MultivaluedMap<K,V>key - the keypublic void addAll(K key, V... newValues)
MultivaluedMapNullPointerException 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)
MultivaluedMapNullPointerException 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)
MultivaluedMapaddFirst in interface MultivaluedMap<K,V>key - the keyvalue - the value to be added.public boolean containsKey(Object key)
containsKey in interface Map<K,List<V>>public boolean containsValue(Object value)
containsValue in interface Map<K,List<V>>Copyright © 2007-2014, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.