接口 MultiValueMap<K,V>

类型参数:
K - the key type
V - the value element type
所有超级接口:
Map<K,List<V>>
所有已知实现类:
DefaultMultiValueMap, LinkedMultiValueMap, MultiValueMapAdapter

public interface MultiValueMap<K,V> extends Map<K,List<V>>
Extension of the Map interface that stores multiple values.

From Spring

从以下版本开始:
2.1.7
作者:
Arjen Poutsma, TODAY
2020-01-27 13:06
  • 方法详细资料

    • getFirst

      @Nullable V getFirst(K key)
      Return the first value for the given key.
      参数:
      key - the key
      返回:
      the first value for the specified key, or null if none
    • add

      void add(K key, @Nullable V value)
      Add the given single value to the current list of values for the given key.
      参数:
      key - the key
      value - the value to be added
    • addAll

      default void addAll(K key, @Nullable List<? extends V> values)
      Add all the values of the given list to the current list of values for the given key.
      参数:
      key - they key
      values - the values to be added
    • addAll

      default void addAll(K key, @Nullable Collection<? extends V> values)
      Add all the values of the given list to the current list of values for the given key.
      参数:
      key - they key
      values - the values to be added
      从以下版本开始:
      4.0
    • addAll

      default void addAll(K key, @Nullable Enumeration<? extends V> values)
      Add all the values of the given enumeration to the current enumeration of values for the given key.
      参数:
      key - they key
      values - the values to be added
      从以下版本开始:
      4.0
    • addAll

      default void addAll(@Nullable Map<K,List<V>> values)
      Add all the values of the given MultiValueMap to the current values.
      参数:
      values - the values to be added
    • addAll

      default void addAll(Map.Entry<K,? extends Collection<V>> pair)
      Add all the values of the given MultiValueMap to the current values.
      参数:
      pair - Entry
      从以下版本开始:
      4.0
    • addIfAbsent

      default void addIfAbsent(K key, @Nullable V value)
      Add the given value, only when the map does not contain the given key.
      参数:
      key - the key
      value - the value to be added
    • set

      void set(K key, @Nullable V value)
      Set the given single value under the given key.
      参数:
      key - the key
      value - the value to set
    • setAll

      default void setAll(@Nullable Map<K,V> values)
      Set the given values under.
      参数:
      values - the values.
    • toSingleValueMap

      default Map<K,V> toSingleValueMap()
      Return a Map with the first values contained in this MultiValueMap.
      返回:
      a single value representation of this map
    • toArrayMap

      default Map<K,V[]> toArrayMap(IntFunction<V[]> function)
      从以下版本开始:
      3.0
    • copyToArrayMap

      default void copyToArrayMap(Map<K,V[]> newMap, IntFunction<V[]> mappingFunction)
      从以下版本开始:
      3.0
    • defaults

      static <K, V> DefaultMultiValueMap<K,V> defaults()
      default MultiValueMap
      从以下版本开始:
      4.0
    • from

      static <K, V> DefaultMultiValueMap<K,V> from(Map<K,List<V>> targetMap)
      Adapt a Map<K, List<V>> to an MultiValueMap<K, V>.
      参数:
      targetMap - the original map
      返回:
      the adapted multi-value map (wrapping the original map)
      从以下版本开始:
      4.0
    • from

      @Experimental static <K, V> DefaultMultiValueMap<K,V> from(Map<K,List<V>> targetMap, Function<K,List<V>> mappingFunction)
      Adapt a Map<K, List<V>> to an MultiValueMap<K, V>.
      参数:
      targetMap - the original map
      mappingFunction - list mapping function
      返回:
      the adapted multi-value map (wrapping the original map)
      从以下版本开始:
      4.0
    • copyOf

      static <K, V> DefaultMultiValueMap<K,V> copyOf(Map<K,List<V>> targetMap)
      Adapt a Map<K, List<V>> to an MultiValueMap<K, V>.
      参数:
      targetMap - the original map
      返回:
      the adapted multi-value map (wrapping the original map)
      从以下版本开始:
      4.0
    • copyOf

      static <K, V> DefaultMultiValueMap<K,V> copyOf(Map<K,List<V>> targetMap, Function<K,List<V>> mappingFunction)
    • fromLinkedHashMap

      static <K, V> DefaultMultiValueMap<K,V> fromLinkedHashMap()
      Adapt a LinkedHashMap<K, List<V>> to an MultiValueMap<K, V>.
      从以下版本开始:
      4.0
    • fromLinkedHashMap

      static <K, V> DefaultMultiValueMap<K,V> fromLinkedHashMap(int initialCapacity)
      Adapt a LinkedHashMap<K, List<V>> to an MultiValueMap<K, V>.
      从以下版本开始:
      4.0
    • unmodifiable

      static <K, V> MultiValueMap<K,V> unmodifiable(MultiValueMap<? extends K,? extends V> targetMap)
      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