VALUE
- the type of values to be stored in the mappublic class CaseInsensitiveMap<VALUE> extends Object implements Map<String,VALUE>
Map
with String
s as keys, and the case of a key is ignored for operations involving
keys like put(java.lang.String, VALUE)
, get(java.lang.Object)
, etc. The keys are stored and retrieved in lower case. Use the static factory
methods to create instances of this class (e.g. newConcurrentMap()
).Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<String,VALUE>> |
entrySet() |
boolean |
equals(Object o) |
VALUE |
get(Object key) |
int |
hashCode() |
boolean |
isEmpty() |
Set<String> |
keySet() |
static <VALUE> CaseInsensitiveMap<VALUE> |
newConcurrentMap()
Returns a new instance of
ConcurrentMap with key case-insensitivity. |
static <VALUE> CaseInsensitiveMap<VALUE> |
newHashMap()
Returns a new instance of
HashMap with key case-insensitivity. |
static <VALUE> CaseInsensitiveMap<VALUE> |
newHashMapWithExpectedSize(int expectedSize)
Returns a new instance of
HashMap , with key case-insensitivity, of expected size. |
static <VALUE> CaseInsensitiveMap<VALUE> |
newImmutableMap(Map<? extends String,? extends VALUE> map)
Returns a new instance of
ImmutableMap with key case-insensitivity. |
VALUE |
put(String key,
VALUE value) |
void |
putAll(Map<? extends String,? extends VALUE> map) |
VALUE |
remove(Object key) |
int |
size() |
String |
toString() |
Collection<VALUE> |
values() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public static <VALUE> CaseInsensitiveMap<VALUE> newConcurrentMap()
ConcurrentMap
with key case-insensitivity. See
ConcurrentMap
.VALUE
- type of values to be stored in the mappublic static <VALUE> CaseInsensitiveMap<VALUE> newHashMap()
VALUE
- type of values to be stored in the mappublic static <VALUE> CaseInsensitiveMap<VALUE> newHashMapWithExpectedSize(int expectedSize)
VALUE
- type of values to be stored in the mapexpectedSize
- expected sizepublic static <VALUE> CaseInsensitiveMap<VALUE> newImmutableMap(Map<? extends String,? extends VALUE> map)
ImmutableMap
with key case-insensitivity. This map is built from the given
map. See ImmutableMap
.VALUE
- type of values to be stored in the mapmap
- map to copy frompublic boolean containsKey(Object key)
containsKey
in interface Map<String,VALUE>
public boolean containsValue(Object value)
containsValue
in interface Map<String,VALUE>
public int hashCode()
public boolean equals(Object o)
Copyright © 1970 The Apache Software Foundation. All rights reserved.