MultivaluedMap that is backed by a [key, multi-value] store represented
as a Map<K, List<V>>.
| Modifier and Type | Field and Description |
|---|---|
| protected final Map | store
Backing store for the [key, multi-value] pairs. |
| Access | Constructor and Description |
|---|---|
| public | AbstractMultivaluedMap(final Map<K, List<V>>
the backing store)Map to be used as a [key, multi-value] store. Must not be null.Initialize the backing store in the abstract parent multivalued map implementation. |
| Modifier and Type | Method and Description |
|---|---|
| public final void | add(final K
the key key, final V the value to be added. value)Implements jakarta. Add a value to the current list of values for the supplied key. |
| public final void | addAll(final K
the key. key, final V... the values to be added. newValues)Implements jakarta. Add multiple values to the current list of values for the supplied key. |
| public final void | addAll(final K
the key. key, final List<V> the list of values to be added. valueList)Implements jakarta. Add all the values from the supplied value list to the current list of values for the supplied key. |
| public final void | addFirst(final K
the key key, final V the value to be added. value)Implements jakarta. Add a value to the first position in the current list of values for the supplied key. |
| protected void | addFirstNull(final List<V>
value list where the values)null value addition is being requested.
Define the behavior for adding a |
| protected void | |
| public void | clear()
Implements java. Removes all of the mappings from this map (optional operation). |
| public boolean | containsKey(final Object
key whose presence in this map is to be tested key)Implements java. Returns |
| public boolean | containsValue(final Object
value whose presence in this map is to be tested value)Implements java. Returns |
| public Set | entrySet()
Implements java. Returns a |
| public boolean | Returns: true if the specified object is equal to the underlying [key, multi-value] store, false
otherwise.object to be compared for equality with this map o)Overrides java. Implements java. Compares the specified object with this map for equality. |
| public boolean | equalsIgnoreValueOrder(final MultivaluedMap<K, V>
map to be compared to this one. omap)Implements jakarta. Compare the specified map with this map for equality modulo the order of values for each key. |
| public List | get(final Object
the key whose associated value is to be returned key)Implements java. Returns the value to which the specified key is mapped,
or |
| public final V | getFirst(final K
the key key)Implements jakarta. A shortcut to get the first value of the supplied key. |
| protected final List | Returns: value list registered with the key. The method is guaranteed to never returnnull.the key. key)Return a non-null list of values for a given key. |
| public int | Returns: a hash code value for the underlying [key, multi-value] store.Overrides java. Implements java. Returns the hash code value for this map. |
| public boolean | |
| public Set | |
| public List | put(final K
key with which the specified value is to be associated key, final List<V> value to be associated with the specified key value)Implements java. Associates the specified value with the specified key in this map (optional operation). |
| public void | putAll(final Map<? extends K, ? extends List<V>>
mappings to be stored in this map m)Implements java. Copies all of the mappings from the specified map to this map (optional operation). |
| public final void | putSingle(final K
the key key, final V the single value of the key. If the value is value)null it will be ignored.Implements jakarta. Set the value for the key to be a one item list consisting of the supplied value. |
| public List | remove(final Object
key whose mapping is to be removed from the map key)Implements java. Removes the mapping for a key from this map if it is present (optional operation). |
| public int | |
| public String | |
| public Collection | values()
Implements java. Returns a |
| store | back to summary |
|---|---|
| protected final Map<K, List<V>> store Backing store for the [key, multi-value] pairs. | |
| AbstractMultivaluedMap | back to summary |
|---|---|
| public AbstractMultivaluedMap(final Map<K, List<V>> store) Initialize the backing store in the abstract parent multivalued map implementation.
| |
| add | back to summary |
|---|---|
| public final void add(final K key, final V value) Implements jakarta. Add a value to the current list of values for the supplied key. NOTE: This implementation ignoresnull values; A supplied value of null is ignored and not added to
the value list. Overriding implementations may modify this behavior by redefining the
addNull(java. method.
| |
| addAll | back to summary |
|---|---|
| public final void addAll(final K key, final V... newValues) Implements jakarta.
Add multiple values to the current list of values for the supplied key. If the supplied array of new values is empty,
method returns immediately. Method throws a null values; Any of the supplied values of null is ignored and not
added to the value list. Overriding implementations may modify this behavior by redefining the
addNull(java. method.
| |
| addAll | back to summary |
|---|---|
| public final void addAll(final K key, final List<V> valueList) Implements jakarta.
Add all the values from the supplied value list to the current list of values for the supplied key. If the supplied
value list is empty, method returns immediately. Method throws a null values; Any null value in the supplied value list is ignored
and not added to the value list. Overriding implementations may modify this behavior by redefining the
addNull(java. method.
| |
| addFirst | back to summary |
|---|---|
| public final void addFirst(final K key, final V value) Implements jakarta. Add a value to the first position in the current list of values for the supplied key. NOTE: This implementation ignoresnull values; A supplied value of null is ignored and not added to
the purged value list. Overriding implementations may modify this behavior by redefining the
addFirstNull(java. method.
| |
| addFirstNull | back to summary |
|---|---|
| protected void addFirstNull(final List<V> values)
Define the behavior for adding a null values are ignored. Overriding implementations may modify
this behavior by providing their own definitions of this method.
| |
| addNull | back to summary |
|---|---|
| protected void addNull(final List<V> values)
Define the behavior for adding a null values are ignored. Overriding implementations may modify
this behavior by providing their own definitions of this method.
| |
| clear | back to summary |
|---|---|
| public void clear() Implements java. Doc from java. Removes all of the mappings from this map (optional operation). The map will be empty after this call returns.
| |
| containsKey | back to summary |
|---|---|
| public boolean containsKey(final Object key) Implements java. Doc from java. Returns | |
| containsValue | back to summary |
|---|---|
| public boolean containsValue(final Object value) Implements java. Doc from java. Returns | |
| entrySet | back to summary |
|---|---|
| public Set Implements java. Doc from java. Returns a | |
| equals | back to summary |
|---|---|
| public boolean equals(final Object o) Overrides java. Implements java. Doc from java. Compares the specified object with this map for equality. Returns
This implementation delegates the method call to to the the underlying [key, multi-value] store.
| |
| equalsIgnoreValueOrder | back to summary |
|---|---|
| public boolean equalsIgnoreValueOrder(final MultivaluedMap<K, V> omap) Implements jakarta. Doc from jakarta. Compare the specified map with this map for equality modulo the order of values for each key. Specifically, the values associated with each key are compared as if they were ordered lists.
| |
| get | back to summary |
|---|---|
| public List Implements java. Doc from java. Returns the value to which the specified key is mapped,
or More formally, if this map contains a mapping from a key
If this map permits null values, then a return value of
| |
| getFirst | back to summary |
|---|---|
| public final V getFirst(final K key) Implements jakarta. Doc from jakarta. A shortcut to get the first value of the supplied key.
| |
| getValues | back to summary |
|---|---|
| protected final List Return a non-null list of values for a given key. The returned list may be empty. If there is no entry for the key in the map, a new emptyList instance is created, registered within the map
to hold the values of the key and returned from the method.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Implements java. Doc from java. Returns the hash code value for this map. The hash code of a map is
defined to be the sum of the hash codes of each entry in the map's
This implementation delegates the method call to to the the underlying [key, multi-value] store.
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Implements java. Doc from java. Returns
| |
| keySet | back to summary |
|---|---|
| public Set Implements java. Doc from java. Returns a | |
| put | back to summary |
|---|---|
| public List Implements java. Doc from java. Associates the specified value with the specified key in this map
(optional operation). If the map previously contained a mapping for
the key, the old value is replaced by the specified value. (A map
| |
| putAll | back to summary |
|---|---|
| public void putAll(final Map<? extends K, ? extends List<V>> m) Implements java. Doc from java. Copies all of the mappings from the specified map to this map
(optional operation). The effect of this call is equivalent to that
of calling | |
| putSingle | back to summary |
|---|---|
| public final void putSingle(final K key, final V value) Implements jakarta. Set the value for the key to be a one item list consisting of the supplied value. Any existing values will be replaced. NOTE: This implementation ignoresnull values; A supplied value of null is ignored and not added to
the purged value list. As a result of such operation, empty value list would be registered for the supplied key.
Overriding implementations may modify this behavior by redefining the addNull(java. method.
| |
| remove | back to summary |
|---|---|
| public List Implements java. Doc from java. Removes the mapping for a key from this map if it is present
(optional operation). More formally, if this map contains a mapping
from key Returns the value to which this map previously associated the key,
or If this map permits null values, then a return value of
The map will not contain a mapping for the specified key once the call returns. | |
| size | back to summary |
|---|---|
| public int size() Implements java. Doc from java. Returns the number of key-value mappings in this map. If the
map contains more than
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| values | back to summary |
|---|---|
| public Collection Implements java. Doc from java. Returns a
| |