Package org.forgerock.http.util
Class MultiValueMap<K,V>
- java.lang.Object
- 
- org.forgerock.util.MapDecorator<K,List<V>>
- 
- org.forgerock.http.util.MultiValueMap<K,V>
 
 
- 
- Type Parameters:
- K- Key type
- V- Value type (of the list)
 - Direct Known Subclasses:
- Form
 
 public class MultiValueMap<K,V> extends MapDecorator<K,List<V>> Wraps a map for which the values are lists, providing a set of convenience methods for handling list values.
- 
- 
Field Summary- 
Fields inherited from class org.forgerock.util.MapDecoratormap
 
- 
 - 
Constructor SummaryConstructors Constructor Description MultiValueMap(Map<K,List<V>> map)Creates a new multi-value map, wrapping an existing map with list values.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(K key, V value)Adds the specified value to the list for the specified key.voidaddAll(Map<? extends K,Collection<? extends V>> map)Adds the specified keys and values from the specified map into this map.voidaddAll(K key, Collection<? extends V> values)Adds the specified values to the list for the specified key.voidaddAll(MultiValueMap<K,V> map)Adds the specified keys and values from the specified map into this map.VgetFirst(K key)Returns the first value in the list of values for the matching key, ornullif no such value exists.voidputSingle(K key, V value)Maps a single value to the specified key, replacing any value(s) that are already mapped to that key.- 
Methods inherited from class org.forgerock.util.MapDecoratorclear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 - 
Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface java.util.Mapcompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
 
- 
 
- 
- 
- 
Method Detail- 
addpublic void add(K key, V value) Adds the specified value to the list for the specified key. If no list for the key yet exists in the map, a new list is created and added.- Parameters:
- key- the key of the list to add the value to.
- value- the value to be added to the list.
 
 - 
addAllpublic void addAll(K key, Collection<? extends V> values) Adds the specified values to the list for the specified key. If no list for the key yet exists in the map, a new list is created and added.- Parameters:
- key- the key of the list to add the values to.
- values- the values to be added to the list.
 
 - 
addAllpublic void addAll(MultiValueMap<K,V> map) Adds the specified keys and values from the specified map into this map.- Parameters:
- map- the map whose keys and values are to be added.
 
 - 
addAllpublic void addAll(Map<? extends K,Collection<? extends V>> map) Adds the specified keys and values from the specified map into this map.- Parameters:
- map- the map whose keys and values are to be added.
 
 - 
getFirstpublic V getFirst(K key) Returns the first value in the list of values for the matching key, ornullif no such value exists.- Parameters:
- key- the key whose associated first item is to be returned.
- Returns:
- the first value in the key's value list, or null if non-existent.
 
 
- 
 
-