Class MultiValueMapAdapter<K,V>

java.lang.Object
org.springframework.util.MultiValueMapAdapter<K,V>
Type Parameters:
K - the key type
V - the value element type
All Implemented Interfaces:
Serializable, Map<K,List<V>>, MultiValueMap<K,V>
Direct Known Subclasses:
LinkedMultiValueMap

public class MultiValueMapAdapter<K,V> extends Object implements MultiValueMap<K,V>, Serializable
Adapts a given Map to the MultiValueMap contract.
Since:
5.3
Author:
Arjen Poutsma, Juergen Hoeller
See Also:
  • Constructor Details

    • MultiValueMapAdapter

      public MultiValueMapAdapter(Map<K,List<V>> targetMap)
      Wrap the given target Map as a MultiValueMap adapter.
      Parameters:
      targetMap - the plain target Map
  • Method Details

    • getFirst

      @Nullable public V getFirst(K key)
      Description copied from interface: MultiValueMap
      Return the first value for the given key.
      Specified by:
      getFirst in interface MultiValueMap<K,V>
      Parameters:
      key - the key
      Returns:
      the first value for the specified key, or null if none
    • add

      public void add(