Package com.stripe.util
Class CaseInsensitiveMap<V>
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<String,
V>
public class CaseInsensitiveMap<V>
extends AbstractMap<String,V>
implements Map<String,V>, Cloneable, Serializable
A case-insensitive
Map
.
All keys are expected to be strings (though null
is a valid key). The map remembers
the case of the last key to be set, and Map.keySet()
or Map.entrySet()
will
contain case-sensitive keys. However, querying and contains testing is case insensitive.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
boolean
containsKey
(Object key) boolean
containsValue
(Object value) entrySet()
keySet()
static <V> CaseInsensitiveMap<V>
Returns an instance ofCaseInsensitiveMap
using the contents of another map.values()
Methods inherited from class java.util.AbstractMap
clone, equals, hashCode, isEmpty, putAll, size, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, isEmpty, merge, putAll, putIfAbsent, remove, replace, replace, replaceAll, size
-
Constructor Details
-
CaseInsensitiveMap
public CaseInsensitiveMap()Instantiates a new instance of theCaseInsensitiveMap
class.
-
-
Method Details
-
of
Returns an instance ofCaseInsensitiveMap
using the contents of another map.- Parameters:
map
- the map to create theCaseInsensitiveMap
from- Returns:
- the
CaseInsensitiveMap
-
containsKey
- Specified by:
containsKey
in interfaceMap<String,
V> - Overrides:
containsKey
in classAbstractMap<String,
V>
-
containsValue
- Specified by:
containsValue
in interfaceMap<String,
V> - Overrides:
containsValue
in classAbstractMap<String,
V>
-
get
-
put
-
remove
-
clear
public void clear() -
keySet
-
values
-
entrySet
-