接口 MultiValueMap<K,V>
- 类型参数:
K- the key typeV- the value element type
Extension of the
Map interface that stores multiple values.- 从以下版本开始:
- 2.1.7 2020-01-27 13:06
- 作者:
- Arjen Poutsma, Harry Yang
-
嵌套类概要
-
字段概要
字段 -
方法概要
修饰符和类型方法说明default voidvoidAdd the given single value to the current list of values for the given key.default voidaddAll(Map.Entry<K, ? extends Collection<V>> pair) Add all the values of the givenMultiValueMapto the current values.default voidAdd all the values of the givenMultiValueMapto the current values.default voidaddAll(K key, Collection<? extends V> values) Add all the values of the given list to the current list of values for the given key.default voidaddAll(K key, Enumeration<? extends V> values) Add all the values of the given enumeration to the current enumeration of values for the given key.default voidAdd all the values of the given list to the current list of values for the given key.default voidaddIfAbsent(K key, V value) default MultiValueMap<K,V> Apply a read-onlyMultiValueMapwrapper around thisMultiValueMap, if necessary.default MultiValueMap<K,V> Remove any read-only wrapper that may have been previously applied around this map viaasReadOnly().static <K,V> LinkedMultiValueMap<K, V> Adapt aMap<K, List<V>>to anMultiValueMap<K, V>.default voidcopyToArrayMap(Map<K, V[]> newMap, IntFunction<V[]> mappingFunction) static <K,V> MultiValueMap<K, V> empty()static <K,V> MappingMultiValueMap<K, V> forAdaption(Function<K, List<V>> mappingFunction) Adapt aHashMap<K, List<V>>to anMultiValueMap<K, V>with a list value mapping function.static <K,V> MultiValueMapAdapter<K, V> forAdaption(Map<K, List<V>> targetMap) Adapt aMap<K, List<V>>to anMultiValueMap<K, V>.static <K,V> MappingMultiValueMap<K, V> forAdaption(Map<K, List<V>> targetMap, Function<K, List<V>> mappingFunction) Adapt aMap<K, List<V>>to anMultiValueMap<K, V>.static <K,V> LinkedMultiValueMap<K, V> Adapt aLinkedHashMap<K, List<V>>to anMultiValueMap<K, V>.static <K,V> LinkedMultiValueMap<K, V> forLinkedHashMap(int expectedSize) Adapt aLinkedHashMap<K, List<V>>to anMultiValueMap<K, V>.static <K,V> MappingMultiValueMap<K, V> Adapt aHashMap<K, List<V>>to anMultiValueMap<K, V>with a smart list value mapping function.static <K,V> MappingMultiValueMap<K, V> forSmartListAdaption(Map<K, List<V>> targetMap) Adapt aHashMap<K, List<V>>to anMultiValueMap<K, V>with a smart list value mapping function.Return the first value for the given key.voidSet the given single value under the given key.default voidSet the given values under.toArrayMap(IntFunction<V[]> function) Return aMapwith the first values contained in thisMultiValueMap.从接口继承的方法 java.util.Map
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
-
字段详细资料
-
defaultMappingFunction
-
smartListMappingFunction
-
EMPTY
-
-
方法详细资料
-
getFirst
Return the first value for the given key.- 参数:
key- the key- 返回:
- the first value for the specified key, or
nullif none
-
add
Add the given single value to the current list of values for the given key.- 参数:
key- the keyvalue- the value to be added
-
add
-
addAll
Add all the values of the given list to the current list of values for the given key.- 参数:
key- they keyvalues- the values to be added- 从以下版本开始:
- 4.0
-
addAll
Add all the values of the given list to the current list of values for the given key.- 参数:
key- they keyvalues- the values to be added- 从以下版本开始:
- 4.0
-
addAll
Add all the values of the given enumeration to the current enumeration of values for the given key.- 参数:
key- they keyvalues- the values to be added- 从以下版本开始:
- 4.0
-
addAll
Add all the values of the givenMultiValueMapto the current values.- 参数:
values- the values to be added
-
addAll
Add all the values of the givenMultiValueMapto the current values.- 参数:
pair- Entry- 从以下版本开始:
- 4.0
-
addIfAbsent
- 参数:
key- the keyvalue- the value to be added
-
set
Set the given single value under the given key.- 参数:
key- the keyvalue- the value to set
-
setAll
Set the given values under.- 参数:
values- the values.
-
toSingleValueMap
Return aMapwith the first values contained in thisMultiValueMap.- 返回:
- a single value representation of this map
-
toArrayMap
- 从以下版本开始:
- 3.0
-
copyToArrayMap
- 从以下版本开始:
- 3.0
-
asReadOnly
Apply a read-onlyMultiValueMapwrapper around thisMultiValueMap, if necessary.- 返回:
- a read-only variant of the MultiValueMap, or the original map as-is
- 从以下版本开始:
- 4.0
-
asWritable
Remove any read-only wrapper that may have been previously applied around this map viaasReadOnly().- 返回:
- a writable variant of the MultiValueMap, or the original headers as-is
- 从以下版本开始:
- 4.0
-
empty
-
forAdaption
Adapt aMap<K, List<V>>to anMultiValueMap<K, V>.- 参数:
targetMap- the original map- 返回:
- the adapted multi-value map (wrapping the original map)
- 从以下版本开始:
- 4.0
-
forAdaption
Adapt aHashMap<K, List<V>>to anMultiValueMap<K, V>with a list value mapping function.- 类型参数:
K- keyV- value type- 返回:
- MappingMultiValueMap
-
forSmartListAdaption
Adapt aHashMap<K, List<V>>to anMultiValueMap<K, V>with a smart list value mapping function.- 类型参数:
K- keyV- value type- 返回:
- MappingMultiValueMap
-
forSmartListAdaption
Adapt aHashMap<K, List<V>>to anMultiValueMap<K, V>with a smart list value mapping function.- 类型参数:
K- keyV- value type- 返回:
- MappingMultiValueMap
-
forAdaption
static <K,V> MappingMultiValueMap<K,V> forAdaption(Map<K, List<V>> targetMap, Function<K, List<V>> mappingFunction) Adapt aMap<K, List<V>>to anMultiValueMap<K, V>.- 参数:
targetMap- the original mapmappingFunction- list mapping function- 返回:
- the adapted multi-value map (wrapping the original map)
- 从以下版本开始:
- 4.0
-
copyOf
Adapt aMap<K, List<V>>to anMultiValueMap<K, V>.- 参数:
targetMap- the original map- 返回:
- the adapted multi-value map (wrapping the original map)
- 从以下版本开始:
- 4.0
-
forLinkedHashMap
Adapt aLinkedHashMap<K, List<V>>to anMultiValueMap<K, V>.- 从以下版本开始:
- 4.0
-
forLinkedHashMap
Adapt aLinkedHashMap<K, List<V>>to anMultiValueMap<K, V>.- 参数:
expectedSize- the expected number of elements (with a corresponding capacity to be derived so that no resize/rehash operations are needed)- 从以下版本开始:
- 4.0
-