Class LinkedCaseInsensitiveMultiValueMap<V>

  • All Implemented Interfaces:
    MultiValueMap<java.lang.String,​V>, java.io.Serializable, java.util.Map<java.lang.String,​java.util.List<V>>

    public class LinkedCaseInsensitiveMultiValueMap<V>
    extends java.lang.Object
    implements MultiValueMap<java.lang.String,​V>, java.io.Serializable

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

    LinkedHashMap variant that stores String keys in a case-insensitive manner, for example for key-based access in a results table.

    Preserves the original order as well as the original casing of keys, while allowing for contains, get and remove calls with any case of key.

    Does not support null keys.

    See Also:
    Serialized Form
    • 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 Concrete Methods 
      Modifier and Type Method Description
      void add​(java.lang.String key, V value)
      Add the given single value to the current list of values for the given key.
      void clear()  
      boolean containsKey​(java.lang.Object key)  
      boolean containsValue​(java.lang.Object value)  
      java.util.Set<java.util.Map.Entry<java.lang.String,​java.util.List<V>>> entrySet()  
      boolean equals​(java.lang.Object other)  
      java.util.List<V> get​(java.lang.Object key)  
      V getFirst​(java.lang.String key)
      Return the first value for the given key.
      int hashCode()  
      boolean isEmpty()  
      java.util.Set<java.lang.String> keySet()  
      java.util.List<V> put​(java.lang.String key, java.util.List<V> value)  
      void put​(java.lang.String key, V[] values)
      Set the given values under the given key.
      void putAll​(java.util.Map<? extends java.lang.String,​? extends java.util.List<V>> map)  
      java.util.List<V> remove​(java.lang.Object key)  
      void set​(java.lang.String key, V value)
      Set the given single value under the given key.
      void setAll​(java.util.Map<java.lang.String,​V> values)
      Set the given values under.
      int size()  
      java.util.Map<java.lang.String,​V> toSingleValueMap()
      Returns the first values contained in this MultiValueMap.
      java.lang.String toString()  
      java.util.Collection<java.util.List<V>> values()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

        compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
    • Constructor Detail

      • LinkedCaseInsensitiveMultiValueMap

        public LinkedCaseInsensitiveMultiValueMap()
        Constructs a new, empty instance of the LinkedCaseInsensitiveMultiValueMap object.
      • LinkedCaseInsensitiveMultiValueMap

        public LinkedCaseInsensitiveMultiValueMap​(int initialCapacity)
        Constructs a new, empty instance of the LinkedCaseInsensitiveMultiValueMap object.
        Parameters:
        initialCapacity - the initial capacity
    • Method Detail

      • getFirst

        public V getFirst​(java.lang.String key)
        Description copied from interface: MultiValueMap
        Return the first value for the given key.
        Specified by:
        getFirst in interface MultiValueMap<java.lang.String,​V>
        Parameters:
        key - the key
        Returns:
        the first value for the specified key, or null
      • add

        public void add​(java.lang.String key,
                        V value)
        Description copied from interface: MultiValueMap
        Add the given single value to the current list of values for the given key.
        Specified by:
        add in interface MultiValueMap<java.lang.String,​V>
        Parameters:
        key - the key
        value - the value to be added
      • set

        public void set​(java.lang.String key,
                        V value)
        Description copied from interface: MultiValueMap
        Set the given single value under the given key.
        Specified by:
        set in interface MultiValueMap<java.lang.String,​V>
        Parameters:
        key - the key
        value - the value to set
      • setAll

        public void setAll​(java.util.Map<java.lang.String,​V> values)
        Description copied from interface: MultiValueMap
        Set the given values under.
        Specified by:
        setAll in interface MultiValueMap<java.lang.String,​V>
        Parameters:
        values - the values
      • put

        public void put​(java.lang.String key,
                        V[] values)
        Description copied from interface: MultiValueMap
        Set the given values under the given key.
        Specified by:
        put in interface MultiValueMap<java.lang.String,​V>
        Parameters:
        key - the key
        values - the values
      • toSingleValueMap

        public java.util.Map<java.lang.String,​V> toSingleValueMap()
        Description copied from interface: MultiValueMap
        Returns the first values contained in this MultiValueMap.
        Specified by:
        toSingleValueMap in interface MultiValueMap<java.lang.String,​V>
        Returns:
        a single value representation of this map
      • size

        public int size()
        Specified by:
        size in interface java.util.Map<java.lang.String,​java.util.List<V>>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Map<java.lang.String,​java.util.List<V>>
      • containsKey

        public boolean containsKey​(java.lang.Object key)
        Specified by:
        containsKey in interface java.util.Map<java.lang.String,​java.util.List<V>>
      • containsValue

        public boolean containsValue​(java.lang.Object value)
        Specified by:
        containsValue in interface java.util.Map<java.lang.String,​java.util.List<V>>
      • get

        public java.util.List<V> get​(java.lang.Object key)
        Specified by:
        get in interface java.util.Map<java.lang.String,​java.util.List<V>>
      • put

        public java.util.List<V> put​(java.lang.String key,
                                     java.util.List<V> value)
        Specified by:
        put in interface java.util.Map<java.lang.String,​java.util.List<V>>
      • remove

        public java.util.List<V> remove​(java.lang.Object key)
        Specified by:
        remove in interface java.util.Map<java.lang.String,​java.util.List<V>>
      • putAll

        public void putAll​(@NonNull
                           java.util.Map<? extends java.lang.String,​? extends java.util.List<V>> map)
        Specified by:
        putAll in interface java.util.Map<java.lang.String,​java.util.List<V>>
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Map<java.lang.String,​java.util.List<V>>
      • keySet

        @NonNull
        public java.util.Set<java.lang.String> keySet()
        Specified by:
        keySet in interface java.util.Map<java.lang.String,​java.util.List<V>>
      • values

        @NonNull
        public java.util.Collection<java.util.List<V>> values()
        Specified by:
        values in interface java.util.Map<java.lang.String,​java.util.List<V>>
      • entrySet

        @NonNull
        public java.util.Set<java.util.Map.Entry<java.lang.String,​java.util.List<V>>> entrySet()
        Specified by:
        entrySet in interface java.util.Map<java.lang.String,​java.util.List<V>>
      • equals

        public boolean equals​(java.lang.Object other)
        Specified by:
        equals in interface java.util.Map<java.lang.String,​java.util.List<V>>
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Map<java.lang.String,​java.util.List<V>>
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object