Interface MultiValueMap<K,​V>

  • All Superinterfaces:
    java.util.Map<K,​java.util.List<V>>
    All Known Implementing Classes:
    LinkedCaseInsensitiveMultiValueMap, LinkedMultiValueMap

    public interface MultiValueMap<K,​V>
    extends java.util.Map<K,​java.util.List<V>>

    This class is a clone of org.springframework.util.MultiValueMap

    Extension of the Map interface that stores multiple values.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      void add​(K key, V value)
      Add the given single value to the current list of values for the given key.
      void addAll​(MultiValueMap<K,​V> values)
      Add all the values of the given MultiValueMap to the current values.
      void addAll​(K key, java.util.List<? extends V> values)
      Add all the values of the given list to the current list of values for the given key.
      default void addIfAbsent​(K key, V value)
      Add the given value, only when the map does not contain the given key.
      V getFirst​(K key)
      Return the first value for the given key.
      void set​(K key, V value)
      Set the given single value under the given key.
      void set​(K key, V[] values)
      Set the given values under the given key.
      void setAll​(java.util.Map<K,​V> values)
      Set the given values under.
      java.util.Map<K,​V> toSingleValueMap()
      Return a Map with the first values contained in this MultiValueMap.
      • Methods inherited from interface 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
    • Method Detail

      • getFirst

        V getFirst​(K key)
        Return the first value for the given key.
        Parameters:
        key - the key
        Returns:
        the first value for the specified key, or null
      • add

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

        void addAll​(K key,
                    java.util.List<? extends V> values)
        Add all the values of the given list to the current list of values for the given key.
        Parameters:
        key - they key
        values - the values to be added
      • addAll

        void addAll​(MultiValueMap<K,​V> values)
        Add all the values of the given MultiValueMap to the current values.
        Parameters:
        values - the values to be added
      • addIfAbsent

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

        void set​(K key,
                 V value)
        Set the given single value under the given key.
        Parameters:
        key - the key
        value - the value to set
      • set

        void set​(K key,
                 V[] values)
        Set the given values under the given key.
        Parameters:
        key - the key
        values - the values
      • setAll

        void setAll​(java.util.Map<K,​V> values)
        Set the given values under.
        Parameters:
        values - the values
      • toSingleValueMap

        java.util.Map<K,​V> toSingleValueMap()
        Return a Map with the first values contained in this MultiValueMap.
        Returns:
        a single value representation of this map