Class CaseInsensitiveMap<T>

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

    public class CaseInsensitiveMap<T>
    extends java.lang.Object
    implements java.util.Map<java.lang.String,​T>
    Case-insensitive map. Unlike the apache commons implementation it doesn't simply lowercase key set, but stores keys as they have been put for the first time.
    Author:
    Sergey.Anchipolevsky Date: 10.01.2008
    • 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 clear()  
      boolean containsKey​(java.lang.Object key)  
      boolean containsValue​(java.lang.Object value)  
      java.util.Set<java.util.Map.Entry<java.lang.String,​T>> entrySet()  
      T get​(java.lang.Object key)  
      boolean isEmpty()  
      java.util.Set<java.lang.String> keySet()  
      T put​(java.lang.String key, T value)  
      void putAll​(java.util.Map<? extends java.lang.String,​? extends T> t)  
      T remove​(java.lang.Object key)  
      int size()  
      java.lang.String toString()  
      java.util.Collection<T> values()  
      • Methods inherited from class java.lang.Object

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

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

      • CaseInsensitiveMap

        public CaseInsensitiveMap()
      • CaseInsensitiveMap

        public CaseInsensitiveMap​(@NotNull
                                  java.util.Map<java.lang.String,​T> source)
    • Method Detail

      • size

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

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

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

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

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

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

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

        public void putAll​(java.util.Map<? extends java.lang.String,​? extends T> t)
        Specified by:
        putAll in interface java.util.Map<java.lang.String,​T>
      • clear

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

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

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

        public java.util.Set<java.util.Map.Entry<java.lang.String,​T>> entrySet()
        Specified by:
        entrySet in interface java.util.Map<java.lang.String,​T>
      • toString

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