类 MappingMultiValueMap<K,V>
java.lang.Object
cn.taketoday.util.MultiValueMapAdapter<K,V>
cn.taketoday.util.MappingMultiValueMap<K,V>
- 类型参数:
K- the key typeV- the value element type
- 所有已实现的接口:
ArraySizeTrimmer,MultiValueMap<K,,V> Serializable,Map<K,List<V>>
public class MappingMultiValueMap<K,V>
extends MultiValueMapAdapter<K,V>
implements MultiValueMap<K,V>, Serializable, ArraySizeTrimmer
Simple implementation of
MultiValueMap that wraps a Map,
storing multiple values in a List. Can Specify a mappingFunction
to determine which List you use , default is ArrayList
This Map implementation is generally not thread-safe. It is primarily designed for data structures exposed from request objects, for use in a single thread only.
- 从以下版本开始:
- 2.1.7 2020-01-27 13:15
- 作者:
- Arjen Poutsma, Juergen Hoeller, Harry Yang
- 另请参阅:
-
嵌套类概要
-
字段概要
字段修饰符和类型字段说明private static final long从类继承的字段 cn.taketoday.util.MultiValueMapAdapter
targetMap从接口继承的字段 cn.taketoday.util.MultiValueMap
defaultMappingFunction, EMPTY, smartListMappingFunction -
构造器概要
构造器构造器说明Wrap theHashMapas aMultiValueMapadapter.MappingMultiValueMap(Function<K, List<V>> mappingFunction) Wrap theHashMapas aMultiValueMapadapter.MappingMultiValueMap(Map<K, List<V>> map) Wrap the given targetMapas aMultiValueMapadapter.Wrap the given targetMapas aMultiValueMapadapter. -
方法概要
修饰符和类型方法说明voidAdd the given single value to the current list of values for the given key.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.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.voidSet the given single value under the given key.voidTrims the capacity of this map internal value ArrayList instance to be the list's current size.从类继承的方法 cn.taketoday.util.MultiValueMapAdapter
clear, containsKey, containsValue, entrySet, equals, forEach, get, getFirst, hashCode, isEmpty, keySet, put, putAll, putIfAbsent, remove, size, toString, values从接口继承的方法 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从接口继承的方法 cn.taketoday.util.MultiValueMap
add, addAll, addAll, addAll, addIfAbsent, asReadOnly, asWritable, copyToArrayMap, getFirst, setAll, toArrayMap, toSingleValueMap
-
字段详细资料
-
serialVersionUID
private static final long serialVersionUID- 另请参阅:
-
mappingFunction
-
-
构造器详细资料
-
MappingMultiValueMap
public MappingMultiValueMap()Wrap theHashMapas aMultiValueMapadapter. -
MappingMultiValueMap
Wrap theHashMapas aMultiValueMapadapter.- 参数:
mappingFunction- list value mapping function
-
MappingMultiValueMap
Wrap the given targetMapas aMultiValueMapadapter.- 参数:
map- the plain targetMap
-
MappingMultiValueMap
Wrap the given targetMapas aMultiValueMapadapter.- 参数:
map- the plain targetMapmappingFunction- list value mapping function
-
-
方法详细资料
-
add
从接口复制的说明:MultiValueMapAdd the given single value to the current list of values for the given key.- 指定者:
add在接口中MultiValueMap<K,V> - 覆盖:
add在类中MultiValueMapAdapter<K,V> - 参数:
key- the keyvalue- the value to be added
-
addAll
从接口复制的说明:MultiValueMapAdd all the values of the given list to the current list of values for the given key.- 指定者:
addAll在接口中MultiValueMap<K,V> - 覆盖:
addAll在类中MultiValueMapAdapter<K,V> - 参数:
key- they keyvalues- the values to be added
-
addAll
从接口复制的说明:MultiValueMapAdd all the values of the given enumeration to the current enumeration of values for the given key.- 指定者:
addAll在接口中MultiValueMap<K,V> - 参数:
key- they keyvalues- the values to be added- 从以下版本开始:
- 4.0
-
set
从接口复制的说明:MultiValueMapSet the given single value under the given key.- 指定者:
set在接口中MultiValueMap<K,V> - 覆盖:
set在类中MultiValueMapAdapter<K,V> - 参数:
key- the keyvalue- the value to set
-
trimToSize
public void trimToSize()Trims the capacity of this map internal value ArrayList instance to be the list's current size. An application can use this operation to minimize the storage of an ArrayList instance.- 指定者:
trimToSize在接口中ArraySizeTrimmer- 从以下版本开始:
- 4.0
- 另请参阅:
-