Class LinkedCaseInsensitiveMap<V>

  • Type Parameters:
    V - the value type
    All Implemented Interfaces:
    Serializable, Cloneable, Map<String,​V>

    public class LinkedCaseInsensitiveMap<V>
    extends Object
    implements Map<String,​V>, Serializable, Cloneable
    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. Part of the spring-framework but really we need just this one class.

    Since:
    3.0
    Author:
    Juergen Hoeller, Phillip Webb
    See Also:
    Serialized Form
    • Constructor Detail

      • LinkedCaseInsensitiveMap

        public LinkedCaseInsensitiveMap()
        Create a new LinkedCaseInsensitiveMap that stores case-insensitive keys according to the default Locale (by default in lower case).
        See Also:
        convertKey(String)
      • LinkedCaseInsensitiveMap

        public LinkedCaseInsensitiveMap​(Locale locale)
        Create a new LinkedCaseInsensitiveMap that stores case-insensitive keys according to the given Locale (by default in lower case).
        Parameters:
        locale - the Locale to use for case-insensitive key conversion
        See Also:
        convertKey(String)
      • LinkedCaseInsensitiveMap

        public LinkedCaseInsensitiveMap​(int initialCapacity)
        Create a new LinkedCaseInsensitiveMap that wraps a LinkedHashMap with the given initial capacity and stores case-insensitive keys according to the default Locale (by default in lower case).
        Parameters:
        initialCapacity - the initial capacity
        See Also:
        convertKey(String)
      • LinkedCaseInsensitiveMap

        public LinkedCaseInsensitiveMap​(int initialCapacity,
                                        Locale locale)
        Create a new LinkedCaseInsensitiveMap that wraps a LinkedHashMap with the given initial capacity and stores case-insensitive keys according to the given Locale (by default in lower case).
        Parameters:
        initialCapacity - the initial capacity
        locale - the Locale to use for case-insensitive key conversion
        See Also:
        convertKey(String)