spring-framework / org.springframework.util / LinkedCaseInsensitiveMap

LinkedCaseInsensitiveMap

open class LinkedCaseInsensitiveMap<V : Any> : MutableMap<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.

Author
Juergen Hoeller

Since
3.0

Constructors

<init>

LinkedCaseInsensitiveMap()

Create a new LinkedCaseInsensitiveMap that stores case-insensitive keys according to the default Locale (by default in lower case).

LinkedCaseInsensitiveMap(locale: Locale)

Create a new LinkedCaseInsensitiveMap that stores case-insensitive keys according to the given Locale (by default in lower case).

LinkedCaseInsensitiveMap(initialCapacity: Int)

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).

LinkedCaseInsensitiveMap(initialCapacity: Int, 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).

Properties

entries

open val entries: MutableSet<MutableEntry<String, V>>

keys

open val keys: MutableSet<String>

size

open val size: Int

values

open val values: MutableCollection<V>

Functions

clear

open fun clear(): Unit

clone

open fun clone(): LinkedCaseInsensitiveMap<V>

containsKey

open fun containsKey(key: String): Boolean

containsValue

open fun containsValue(value: V): Boolean

equals

open fun equals(other: Any?): Boolean

get

open fun get(key: String): V?

getLocale

open fun getLocale(): Locale

Return the locale used by this LinkedCaseInsensitiveMap. Used for case-insensitive key conversion.

getOrDefault

open fun getOrDefault(key: String, defaultValue: V): V

hashCode

open fun hashCode(): Int

isEmpty

open fun isEmpty(): Boolean

put

open fun put(key: String, value: V): V?

putAll

open fun putAll(from: Map<out String, V>): Unit

remove

open fun remove(key: String): V?

toString

open fun toString(): String