K
- The type of keys in the map.V
- The type of values in the lists in the map.public class DelegatingMultivaluedMap<K,V> extends Object implements MultivaluedMap<K,V>
MultivaluedMap
implementation that delegates to another instance.
Convenience class for MultivaluedMap
enhancements that don't want to implement all methods.Constructor and Description |
---|
DelegatingMultivaluedMap(MultivaluedMap<K,V> delegate) |
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 o) |
boolean |
containsValue(Object o) |
Set<Map.Entry<K,List<V>>> |
entrySet() |
boolean |
equals(Object o) |
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 o) |
V |
getFirst(K key)
A shortcut to get the first value of the supplied key.
|
int |
hashCode() |
boolean |
isEmpty() |
Set<K> |
keySet() |
List<V> |
put(K k,
List<V> vs) |
void |
putAll(Map<? extends K,? extends List<V>> map) |
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 o) |
int |
size() |
Collection<List<V>> |
values() |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public DelegatingMultivaluedMap(MultivaluedMap<K,V> delegate)
public 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 void putSingle(K key, V value)
MultivaluedMap
putSingle
in interface MultivaluedMap<K,V>
key
- the keyvalue
- the single value of the keypublic void add(K key, V value)
MultivaluedMap
add
in interface MultivaluedMap<K,V>
key
- the keyvalue
- the value to be added.public V getFirst(K key)
MultivaluedMap
getFirst
in interface MultivaluedMap<K,V>
key
- the keypublic boolean containsKey(Object o)
containsKey
in interface Map<K,List<V>>
public boolean containsValue(Object o)
containsValue
in interface Map<K,List<V>>
public boolean equals(Object o)
public int hashCode()
public boolean equalsIgnoreValueOrder(MultivaluedMap<K,V> otherMap)
MultivaluedMap
equalsIgnoreValueOrder
in interface MultivaluedMap<K,V>
otherMap
- map to be compared to this one.Copyright © 2021 JBoss by Red Hat. All rights reserved.