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(MultivaluedMapImpl<K,V> other) |
void |
addMultiple(K key,
Collection<V> values) |
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 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)
Copyright © 2018 JBoss by Red Hat. All rights reserved.