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.SerializableA case-insensitiveMap.All keys are expected to be strings (though
nullis 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 theCaseInsensitiveMapclass.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()booleancontainsKey(java.lang.Object key)booleancontainsValue(java.lang.Object value)java.util.Set<java.util.Map.Entry<java.lang.String,V>>entrySet()Vget(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 ofCaseInsensitiveMapusing the contents of another map.Vput(java.lang.String key, V value)Vremove(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 theCaseInsensitiveMapclass.
-
-
Method Detail
-
of
public static <V> CaseInsensitiveMap<V> of(java.util.Map<java.lang.String,V> map)
Returns an instance ofCaseInsensitiveMapusing the contents of another map.- Parameters:
map- the map to create theCaseInsensitiveMapfrom- 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()
-
-