K - Key typeV - Value type (of the list)public class MultiValueMap<K,V> extends MapDecorator<K,List<V>>
map| Constructor and Description |
|---|
MultiValueMap(Map<K,List<V>> map)
Creates a new multi-value map, wrapping an existing map with list values.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(K key,
V value)
Adds the specified value to the list for the specified key.
|
void |
addAll(K key,
Collection<? extends V> values)
Adds the specified values to the list for the specified key.
|
void |
addAll(Map<? extends K,Collection<? extends V>> map)
Adds the specified keys and values from the specified map into this map.
|
void |
addAll(MultiValueMap<K,V> map)
Adds the specified keys and values from the specified map into this map.
|
V |
getFirst(K key)
Returns the first value in the list of values for the matching key, or
null
if no such value exists. |
void |
putSingle(K key,
V value)
Maps a single value to the specified key, replacing any value(s) that are already
mapped to that key.
|
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, valuesclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAllpublic void add(K key, V value)
key - the key of the list to add the value to.value - the value to be added to the list.public void addAll(K key, Collection<? extends V> values)
key - the key of the list to add the values to.values - the values to be added to the list.public void addAll(MultiValueMap<K,V> map)
map - the map whose keys and values are to be added.public void addAll(Map<? extends K,Collection<? extends V>> map)
map - the map whose keys and values are to be added.public V getFirst(K key)
null
if no such value exists.key - the key whose associated first item is to be returned.Copyright © 2025 Open Identity Platform Community. All rights reserved.