类 MappingMultiValueMap<K,V>

java.lang.Object
cn.taketoday.util.MultiValueMapAdapter<K,V>
cn.taketoday.util.MappingMultiValueMap<K,V>
类型参数:
K - the key type
V - 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
另请参阅:
  • 字段详细资料

    • serialVersionUID

      private static final long serialVersionUID
      另请参阅:
    • mappingFunction

      protected final transient Function<K,List<V>> mappingFunction
  • 构造器详细资料

    • MappingMultiValueMap

      public MappingMultiValueMap()
      Wrap the HashMap as a MultiValueMap adapter.
    • MappingMultiValueMap

      public MappingMultiValueMap(Function<K,List<V>> mappingFunction)
      Wrap the HashMap as a MultiValueMap adapter.
      参数:
      mappingFunction - list value mapping function
    • MappingMultiValueMap

      public MappingMultiValueMap(Map<K,List<V>> map)
      Wrap the given target Map as a MultiValueMap adapter.
      参数:
      map - the plain target Map
    • MappingMultiValueMap

      public MappingMultiValueMap(Map<K,List<V>> map, Function<K,List<V>> mappingFunction)
      Wrap the given target Map as a MultiValueMap adapter.
      参数:
      map - the plain target Map
      mappingFunction - list value mapping function
  • 方法详细资料

    • add

      public void add(K key, @Nullable V value)
      从接口复制的说明: MultiValueMap
      Add the given single value to the current list of values for the given key.
      指定者:
      add 在接口中 MultiValueMap<K,V>
      覆盖:
      add 在类中 MultiValueMapAdapter<K,V>
      参数:
      key - the key
      value - the value to be added
    • addAll

      public void addAll(K key, @Nullable Collection<? extends V> values)
      从接口复制的说明: MultiValueMap
      Add 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 key
      values - the values to be added
    • addAll

      public void addAll(K key, @Nullable Enumeration<? extends V> values)
      从接口复制的说明: MultiValueMap
      Add all the values of the given enumeration to the current enumeration of values for the given key.
      指定者:
      addAll 在接口中 MultiValueMap<K,V>
      参数:
      key - they key
      values - the values to be added
      从以下版本开始:
      4.0
    • set

      public void set(K key, @Nullable V value)
      从接口复制的说明: MultiValueMap
      Set the given single value under the given key.
      指定者:
      set 在接口中 MultiValueMap<K,V>
      覆盖:
      set 在类中 MultiValueMapAdapter<K,V>
      参数:
      key - the key
      value - 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
      另请参阅: