接口 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
-
嵌套类概要
-
字段概要
字段 -
方法概要
修饰符和类型方法说明voidAdd 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 voidaddIfAbsent(K key, V value) static <K,V> LinkedMultiValueMap<K, V> Adapt aMap<K, List<V>>to anMultiValueMap<K, V>.static <K,V> LinkedMultiValueMap<K, V> default voidcopyToArrayMap(Map<K, V[]> newMap, IntFunction<V[]> mappingFunction) static <K,V> DefaultMultiValueMap<K, V> defaults()default MultiValueMapstatic <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> LinkedMultiValueMap<K, V> forLinkedHashMap(int expectedSize, Function<K, List<V>> mappingFunction) Adapt aLinkedHashMap<K, List<V>>to anMultiValueMap<K, V>.static <K,V> LinkedMultiValueMap<K, V> forLinkedHashMap(Function<K, List<V>> mappingFunction) Adapt aLinkedHashMap<K, List<V>>to anMultiValueMap<K, V>.static <K,V> MultiValueMap<K, V> forUnmodifiable(MultiValueMap<? extends K, ? extends V> targetMap) Return an unmodifiable view of the specified multi-value map.static <K,V> DefaultMultiValueMap<K, V> Adapt aMap<K, List<V>>to anMultiValueMap<K, V>.static <K,V> DefaultMultiValueMap<K, V> Adapt aMap<K, List<V>>to anMultiValueMap<K, V>.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
-
-
方法详细资料
-
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
-
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
-
defaults
default MultiValueMap- 从以下版本开始:
- 4.0
-
from
Adapt aMap<K, List<V>>to anMultiValueMap<K, V>.- 参数:
targetMap- the original map- 返回:
- the adapted multi-value map (wrapping the original map)
- 从以下版本开始:
- 4.0
-
from
static <K,V> DefaultMultiValueMap<K,V> from(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
-
copyOf
static <K,V> LinkedMultiValueMap<K,V> copyOf(Map<K, List<V>> targetMap, Function<K, List<V>> mappingFunction) -
forLinkedHashMap
Adapt aLinkedHashMap<K, List<V>>to anMultiValueMap<K, V>.- 从以下版本开始:
- 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
-
forLinkedHashMap
static <K,V> LinkedMultiValueMap<K,V> forLinkedHashMap(int expectedSize, Function<K, List<V>> mappingFunction) 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
-
forUnmodifiable
Return an unmodifiable view of the specified multi-value map.- 参数:
targetMap- the map for which an unmodifiable view is to be returned.- 返回:
- an unmodifiable view of the specified multi-value map
- 从以下版本开始:
- 4.0
-