CaseInsensitiveKeyMap (Apache Tomcat 9.0.111 API Documentation)
Description: declaration: package: org.apache.tomcat.util.collections, class: CaseInsensitiveKeyMap

# Class CaseInsensitiveKeyMap<V>

java.lang.Object
java.util.AbstractMap<String,V>
org.apache.tomcat.util.collections.CaseInsensitiveKeyMap<V>

Type Parameters:
  `V` - Type of values placed in this Map.

All Implemented Interfaces:
  `Map<String,V>`

public class CaseInsensitiveKeyMap<V> extends AbstractMap<String,V>
A Map implementation that uses case-insensitive (using `Locale.ENGLISH`) strings as keys.

Keys must be instances of `String`. Note that this means that `null` keys are not permitted.

This implementation is not thread-safe.

- ## Nested Class Summary

  ### Nested classes/interfaces inherited from class AbstractMap

  `AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>`

  ### Nested classes/interfaces inherited from interface Map

  `Map.Entry<K,V>`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CaseInsensitiveKeyMap()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `containsKey(Object key)`
  `Set<Map.Entry<String,V>>`
  `entrySet()`
  `V`
  `get(Object key)`
  `V`
  `put(String key, V value)`
  `void`
  `putAll(Map<? extends String, ? extends V> m)`
  `V`
  `remove(Object key)`

  ### Methods inherited from class AbstractMap

  `clear, clone, containsValue, equals, hashCode, isEmpty, keySet, size, toString, values`

  ### Methods inherited from class Object

  `finalize, getClass, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface Map

  `compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll`

- ## Constructor Details

  - ### CaseInsensitiveKeyMap

    public CaseInsensitiveKeyMap()

- ## Method Details

  - ### get

    public V get(Object key)
    Specified by:
      `get` in interface `Map<String,V>`
    Overrides:
      `get` in class `AbstractMap<String,V>`

  - ### put

    public V put(String key, V value)
    Specified by:
      `put` in interface `Map<String,V>`
    Overrides:
      `put` in class `AbstractMap<String,V>`

  - ### putAll

    public void putAll(Map<? extends String, ? extends V> m)

    Use this method with caution. If the input Map contains duplicate keys when the keys are compared in a case-insensitive manner then some values will be lost when inserting via this method.

    Specified by:
      `putAll` in interface `Map<String,V>`
    Overrides:
      `putAll` in class `AbstractMap<String,V>`

  - ### containsKey

    public boolean containsKey(Object key)
    Specified by:
      `containsKey` in interface `Map<String,V>`
    Overrides:
      `containsKey` in class `AbstractMap<String,V>`

  - ### remove

    public V remove(Object key)
    Specified by:
      `remove` in interface `Map<String,V>`
    Overrides:
      `remove` in class `AbstractMap<String,V>`

  - ### entrySet

    public Set<Map.Entry<String,V>> entrySet()
    Specified by:
      `entrySet` in interface `Map<String,V>`
    Specified by:
      `entrySet` in class `AbstractMap<String,V>`