Class CaseInsensitiveMap<V>

  • All Implemented Interfaces:, java.lang.Cloneable, java.util.Map<java.lang.String,​V>

    public class CaseInsensitiveMap<V>
    extends java.util.AbstractMap<java.lang.String,​V>
    implements java.util.Map<java.lang.String,​V>, java.lang.Cloneable,
    A case-insensitive Map.

    All keys are expected to be strings (though null is a valid key). The map remembers the case of the last key to be set, and Map.keySet() or Map.entrySet() will contain case-sensitive keys. However, querying and contains testing is case insensitive.

    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
      • 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 Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()  
      boolean containsKey​(java.lang.Object key)  
      boolean containsValue​(java.lang.Object value)  
      java.util.Set<java.util.Map.Entry<java.lang.String,​V>> entrySet()  
      V get​(java.lang.Object key)  
      java.util.Set<java.lang.String> keySet()  
      static <V> CaseInsensitiveMap<V> of​(java.util.Map<java.lang.String,​V> map)
      Returns an instance of CaseInsensitiveMap using the contents of another map.
      V put​(java.lang.String key, V value)  
      V remove​(java.lang.Object key)  
      java.util.Collection<V> values()  
      • Methods inherited from class java.util.AbstractMap

        clone, equals, hashCode, isEmpty, putAll, size, toString
      • Methods inherited from class java.lang.Object

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

        compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, isEmpty, merge, putAll, putIfAbsent, remove, replace, replace, replaceAll, size
    • Constructor Detail

      • CaseInsensitiveMap

        public CaseInsensitiveMap()
        Instantiates a new instance of the CaseInsensitiveMap class.
    • Method Detail

      • containsKey

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

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

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

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

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

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

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

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

        public java.util.Set<java.util.Map.Entry<java.lang.String,​V>> entrySet()
        Specified by:
        entrySet in interface java.util.Map<java.lang.String,​V>
        Specified by:
        entrySet in class java.util.AbstractMap<java.lang.String,​V>