Top Description Methods
org.glassfish.tyrus.core.uri.internal

public Interface MultivaluedMap<K, V>

extends Map<K, List<V>>
Known Direct Implementers
org.glassfish.tyrus.core.uri.internal.AbstractMultivaluedMap
Type Parameters
<K>
the type of keys maintained by this map
<V>
the type of mapped values
Imports
java.util.List, .Map

A map of key-values pairs. Each key can have zero or more values.
Authors
Paul Sandoz, Marc Hadley, Marek Potociar
Since
1.0

Method Summary

Modifier and TypeMethod and Description
public void
add(K
the key
key
,
V
the value to be added.
value
)

Add a value to the current list of values for the supplied key.

public void
addAll(K
the key.
key
,
V...
the values to be added.
newValues
)

Add multiple values to the current list of values for the supplied key.

public void
addAll(K
the key.
key
,
List<V>
the list of values to be added.
valueList
)

Add all the values from the supplied value list to the current list of values for the supplied key.

public void
addFirst(K
the key
key
,
V
the value to be added.
value
)

Add a value to the first position in the current list of values for the supplied key.

public boolean

Returns:

true if the maps are equal modulo value ordering.
equalsIgnoreValueOrder
(MultivaluedMap<K, V>
map to be compared to this one.
otherMap
)

Compare the specified map with this map for equality modulo the order of values for each key.

public V

Returns:

the first value for the specified key or null if the key is not in the map.
getFirst
(K
the key
key
)

A shortcut to get the first value of the supplied key.

public void
putSingle(K
the key
key
,
V
the single value of the key
value
)

Set the key's value to be a one item list consisting of the supplied value.

Inherited from java.util.Map:
clearcomputecomputeIfAbsentcomputeIfPresentcontainsKeycontainsValuecopyOfentryentrySetequalsforEachgetgetOrDefaulthashCodeisEmptykeySetmergeofofofofofofofofofofofofEntriesputputAllputIfAbsentremoveremovereplacereplacereplaceAllsizevalues

Method Detail

addback to summary
public void add(K key, V value)

Add a value to the current list of values for the supplied key.

Parameters
key:K

the key

value:V

the value to be added.

addAllback to summary
public void addAll(K key, V... newValues)

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 NullPointerException if the supplied array of values is null.

Parameters
key:K

the key.

newValues:V[]

the values to be added.

Exceptions
NullPointerException:
if the supplied array of new values is null.
Since
2.0
addAllback to summary
public 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. If the supplied value list is empty, method returns immediately. Method throws a NullPointerException if the supplied array of values is null.

Parameters
key:K

the key.

valueList:List<V>

the list of values to be added.

Exceptions
NullPointerException:
if the supplied value list is null.
Since
2.0
addFirstback to summary
public void addFirst(K key, V value)

Add a value to the first position in the current list of values for the supplied key.

Parameters
key:K

the key

value:V

the value to be added.

Since
2.0
equalsIgnoreValueOrderback to summary
public boolean equalsIgnoreValueOrder(MultivaluedMap<K, V> otherMap)

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.

Parameters
otherMap:MultivaluedMap<K, V>

map to be compared to this one.

Returns:boolean

true if the maps are equal modulo value ordering.

Since
2.0
getFirstback to summary
public V getFirst(K key)

A shortcut to get the first value of the supplied key.

Parameters
key:K

the key

Returns:V

the first value for the specified key or null if the key is not in the map.

putSingleback to summary
public void putSingle(K key, V value)

Set the key's value to be a one item list consisting of the supplied value. Any existing values will be replaced.

Parameters
key:K

the key

value:V

the single value of the key