Class CaseInsensitiveKeysMapAccess


  • public class CaseInsensitiveKeysMapAccess
    extends java.lang.Object
    Wrapper around the map that allows accessing the map with case-insensitive keys. For example, the keys 'hello' and 'Hello' access the same value.

    If there is a conflicting key, any one of the keys and any one of the values is used. Because of the nature of Hashmaps, the result is not deterministic.

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Map<java.lang.String,​java.lang.String> convert​(java.util.Map<java.lang.String,​java.lang.String> map)
      Wrapper around the map that allows accessing the map with case-insensitive keys.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CaseInsensitiveKeysMapAccess

        public CaseInsensitiveKeysMapAccess()
    • Method Detail

      • convert

        public static java.util.Map<java.lang.String,​java.lang.String> convert​(java.util.Map<java.lang.String,​java.lang.String> map)
        Wrapper around the map that allows accessing the map with case-insensitive keys.

        Return an unmodifiable map to make it clear that changes are not reflected to the original map.

        Parameters:
        map - the map to convert
        Returns:
        an unmodifiable map with case-insensitive key access