K - the key typeV - the value element typepublic interface MultiValueMap<K,V> extends Map<K,Collection<V>>
Map interface that stores multiple values.| 限定符和类型 | 方法和说明 |
|---|---|
void |
add(K key,
V value)
Add the given single value to the current list of values for the given key.
|
void |
addAll(K key,
Collection<? extends V> values)
Add all the values of the given list to the current list of values for the given key.
|
void |
addAll(MultiValueMap<K,V> values)
Add all the values of the given
MultiValueMap to the current values. |
void |
addIfAbsent(K key,
V value)
|
V |
getFirst(K key)
Return the first value for the given key.
|
void |
set(K key,
V value)
Set the given single value under the given key.
|
void |
setAll(Map<K,V> values)
Set the given values under.
|
Map<K,List<V>> |
toMap() |
Map<K,V> |
toSingleValueMap()
Return a
Map with the first values contained in this MultiValueMap. |
int |
total() |
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values@Nullable V getFirst(K key)
key - the keynull if nonevoid add(K key, @Nullable V value)
key - the keyvalue - the value to be addedvoid addAll(K key, Collection<? extends V> values)
key - they keyvalues - the values to be addedvoid addAll(MultiValueMap<K,V> values)
MultiValueMap to the current values.values - the values to be addedvoid addIfAbsent(K key, @Nullable V value)
key - the keyvalue - the value to be addedvoid set(K key, @Nullable V value)
key - the keyvalue - the value to setMap<K,V> toSingleValueMap()
Map with the first values contained in this MultiValueMap.int total()
Copyright © 2021. All rights reserved.