Package com.stripe.util
Class CaseInsensitiveMap<V>
- java.lang.Object
-
- java.util.AbstractMap<java.lang.String,V>
-
- com.stripe.util.CaseInsensitiveMap<V>
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.util.Map<java.lang.String,V>
public class CaseInsensitiveMap<V> extends java.util.AbstractMap<java.lang.String,V> implements java.util.Map<java.lang.String,V>, java.lang.Cloneable, java.io.Serializable
A case-insensitiveMap
.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, andMap.keySet()
orMap.entrySet()
will contain case-sensitive keys. However, querying and contains testing is case insensitive.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CaseInsensitiveMap()
Instantiates a new instance of theCaseInsensitiveMap
class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
boolean
containsKey(java.lang.Object key)
boolean
containsValue(java.lang.Object value)
java.util.Set<java.util.Map.Entry<java.lang.String,V>>
entrySet()
V
get(java.lang.Object key)
java.util.Set<java.lang.String>
keySet()
static <V> CaseInsensitiveMap<V>
of(java.util.Map<java.lang.String,V> map)
Returns an instance ofCaseInsensitiveMap
using the contents of another map.V
put(java.lang.String key, V value)
V
remove(java.lang.Object key)
java.util.Collection<V>
values()
-
Methods inherited from class java.util.AbstractMap
clone, equals, hashCode, isEmpty, putAll, size, toString
-
-
-
-
Constructor Detail
-
CaseInsensitiveMap
public CaseInsensitiveMap()
Instantiates a new instance of theCaseInsensitiveMap
class.
-
-
Method Detail
-
of
public static <V> CaseInsensitiveMap<V> of(java.util.Map<java.lang.String,V> map)
Returns an instance ofCaseInsensitiveMap
using the contents of another map.- Parameters:
map
- the map to create theCaseInsensitiveMap
from- Returns:
- the
CaseInsensitiveMap
-
containsKey
public boolean containsKey(java.lang.Object key)
-
containsValue
public boolean containsValue(java.lang.Object value)
-
get
public V get(java.lang.Object key)
-
remove
public V remove(java.lang.Object key)
-
clear
public void clear()
-
keySet
public java.util.Set<java.lang.String> keySet()
-
values
public java.util.Collection<V> values()
-
-