public class

LinkedCaseInsensitiveMap

extends LinkedHashMap<K, V>
java.lang.Object
   ↳ java.util.AbstractMap<K, V>
     ↳ java.util.HashMap<K, V>
       ↳ java.util.LinkedHashMap<K, V>
         ↳ org.springframework.util.LinkedCaseInsensitiveMap<V>

Class Overview

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.

Summary

Public Constructors
LinkedCaseInsensitiveMap()
Create a new LinkedCaseInsensitiveMap for the default Locale.
LinkedCaseInsensitiveMap(Locale locale)
Create a new LinkedCaseInsensitiveMap that stores lower-case keys according to the given Locale.
LinkedCaseInsensitiveMap(int initialCapacity)
Create a new LinkedCaseInsensitiveMap that wraps a LinkedHashMap with the given initial capacity and stores lower-case keys according to the default Locale.
LinkedCaseInsensitiveMap(int initialCapacity, Locale locale)
Create a new LinkedCaseInsensitiveMap that wraps a LinkedHashMap with the given initial capacity and stores lower-case keys according to the given Locale.
Public Methods
void clear()
boolean containsKey(Object key)
V get(Object key)
V put(String key, V value)
V remove(Object key)
Protected Methods
String convertKey(String key)
Convert the given key to a case-insensitive key.
[Expand]
Inherited Methods
From class java.util.LinkedHashMap
From class java.util.HashMap
From class java.util.AbstractMap
From class java.lang.Object
From interface java.util.Map

Public Constructors

public LinkedCaseInsensitiveMap ()

Also: SpringCore

Create a new LinkedCaseInsensitiveMap for the default Locale.

See Also

public LinkedCaseInsensitiveMap (Locale locale)

Also: SpringCore

Create a new LinkedCaseInsensitiveMap that stores lower-case keys according to the given Locale.

Parameters
locale the Locale to use for lower-case conversion

public LinkedCaseInsensitiveMap (int initialCapacity)

Also: SpringCore

Create a new LinkedCaseInsensitiveMap that wraps a LinkedHashMap with the given initial capacity and stores lower-case keys according to the default Locale.

Parameters
initialCapacity the initial capacity
See Also

public LinkedCaseInsensitiveMap (int initialCapacity, Locale locale)

Also: SpringCore

Create a new LinkedCaseInsensitiveMap that wraps a LinkedHashMap with the given initial capacity and stores lower-case keys according to the given Locale.

Parameters
initialCapacity the initial capacity
locale the Locale to use for lower-case conversion

Public Methods

public void clear ()

public boolean containsKey (Object key)

public V get (Object key)

public V put (String key, V value)

Also: SpringCore

public V remove (Object key)

Protected Methods

protected String convertKey (String key)

Also: SpringCore

Convert the given key to a case-insensitive key.

The default implementation converts the key to lower-case according to this Map's Locale.

Parameters
key the user-specified key
Returns
  • the key to use for storing