类 DefaultMultiValueMap<K,V>
java.lang.Object
cn.taketoday.util.DefaultMultiValueMap<K,V>
- 类型参数:
K- the key typeV- the value element type
- 所有已实现的接口:
ArraySizeTrimmer,MultiValueMap<K,,V> Serializable,Cloneable,Map<K,List<V>>
- 直接已知子类:
LinkedMultiValueMap
public class DefaultMultiValueMap<K,V>
extends Object
implements MultiValueMap<K,V>, Serializable, Cloneable, 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
- 作者:
- Arjen Poutsma, Juergen Hoeller, TODAY
2020-01-27 13:15 - 另请参阅:
-
嵌套类概要
-
字段概要
字段修饰符和类型字段说明private static final long从接口继承的字段 cn.taketoday.util.MultiValueMap
defaultMappingFunction -
构造器概要
构造器构造器说明DefaultMultiValueMap(int initialCapacity) DefaultMultiValueMap(int initialCapacity, float loadFactor) DefaultMultiValueMap(int initialCapacity, float loadFactor, Function<K, List<V>> mappingFunction) DefaultMultiValueMap(Function<K, List<V>> mappingFunction) DefaultMultiValueMap(Map<K, List<V>> map) adaptation -
方法概要
修饰符和类型方法说明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.voidclear()clone()Create a regular copy of this Map.cloneMap()booleancontainsKey(Object key) booleancontainsValue(Object value) deepCopy()Create a deep copy of this Map.entrySet()booleanReturn the first value for the given key.inthashCode()booleanisEmpty()keySet()voidvoidSet the given single value under the given key.intsize()toString()voidTrims the capacity of this map internal value ArrayList instance to be the list's current size.Collection<List<V>>values()从接口继承的方法 java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll从接口继承的方法 cn.taketoday.util.MultiValueMap
addAll, addAll, addIfAbsent, copyToArrayMap, setAll, toArrayMap, toSingleValueMap
-
字段详细资料
-
serialVersionUID
private static final long serialVersionUID- 另请参阅:
-
map
-
mappingFunction
-
-
构造器详细资料
-
DefaultMultiValueMap
public DefaultMultiValueMap() -
DefaultMultiValueMap
-
DefaultMultiValueMap
public DefaultMultiValueMap(int initialCapacity) -
DefaultMultiValueMap
public DefaultMultiValueMap(int initialCapacity, float loadFactor) -
DefaultMultiValueMap
-
DefaultMultiValueMap
adaptation -
DefaultMultiValueMap
-
DefaultMultiValueMap
-
-
方法详细资料
-
getFirst
从接口复制的说明:MultiValueMapReturn the first value for the given key.- 指定者:
getFirst在接口中MultiValueMap<K,V> - 参数:
key- the key- 返回:
- the first value for the specified key, or
nullif none
-
add
从接口复制的说明:MultiValueMapAdd the given single value to the current list of values for the given key.- 指定者:
add在接口中MultiValueMap<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> - 参数:
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> - 参数:
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
- 另请参阅:
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- 指定者:
containsKey在接口中Map<K,V>
-
containsValue
- 指定者:
containsValue在接口中Map<K,V>
-
get
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-
deepCopy
Create a deep copy of this Map.- 返回:
- a copy of this Map, including a copy of each value-holding List entry
(consistently using an independent modifiable
Listfor each entry) along the lines ofMultiValueMap.addAllsemantics - 从以下版本开始:
- 2.1.7
- 另请参阅:
-
clone
Create a regular copy of this Map. -
cloneMap
- 从以下版本开始:
- 4.0
-
equals
-
hashCode
public int hashCode() -
toString
-