Package jakarta.ws.rs.core
Interface MultivaluedMap<K,V>
- Type Parameters:
- K- the type of keys maintained by this map
- V- the type of mapped values
- All Known Implementing Classes:
- AbstractMultivaluedMap,- MultivaluedHashMap
public interface MultivaluedMap<K,V> extends Map<K,List<V>>
A map of key-values pairs. Each key can have zero or more values.
- Since:
- 1.0
- Author:
- Paul Sandoz, Marc Hadley, Marek Potociar
- 
Nested Class Summary
- 
Method SummaryModifier and Type Method Description voidadd(K key, V value)Add a value to the current list of values for the supplied key.voidaddAll(K key, List<V> valueList)Add all the values from the supplied value list to the current list of values for the supplied key.voidaddAll(K key, V... newValues)Add multiple values to the current list of values for the supplied key.voidaddFirst(K key, V value)Add a value to the first position in the current list of values for the supplied key.booleanequalsIgnoreValueOrder(MultivaluedMap<K,V> otherMap)Compare the specified map with this map for equality modulo the order of values for each key.VgetFirst(K key)A shortcut to get the first value of the supplied key.voidputSingle(K key, V value)Set the key's value to be a one item list consisting of the supplied value.Methods inherited from interface java.util.Mapclear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
- 
Method Details- 
putSingleSet the key's value to be a one item list consisting of the supplied value. Any existing values will be replaced.- Parameters:
- key- the key
- value- the single value of the key
 
- 
addAdd a value to the current list of values for the supplied key.- Parameters:
- key- the key
- value- the value to be added.
 
- 
getFirstA shortcut to get the first value of the supplied key.- Parameters:
- key- the key
- Returns:
- the first value for the specified key or null if the key is not in the map.
 
- 
addAllAdd 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 aNullPointerExceptionif the supplied array of values isnull.- Parameters:
- key- the key.
- newValues- the values to be added.
- Throws:
- NullPointerException- if the supplied array of new values is- null.
- Since:
- 2.0
 
- 
addAllAdd 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 aNullPointerExceptionif the supplied array of values isnull.- Parameters:
- key- the key.
- valueList- the list of values to be added.
- Throws:
- NullPointerException- if the supplied value list is- null.
- Since:
- 2.0
 
- 
addFirstAdd a value to the first position in the current list of values for the supplied key.- Parameters:
- key- the key
- value- the value to be added.
- Since:
- 2.0
 
- 
equalsIgnoreValueOrderCompare 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- map to be compared to this one.
- Returns:
- true if the maps are equal modulo value ordering.
- Since:
- 2.0
 
 
-