V
- The type of the case insensitive map.public class CaseInsensitiveMap<V> extends MapDecorator<String,V>
keySet()
method for example returns the original keys.
Note: The behavior of this class is undefined when wrapping a map that has keys that would result in duplicate case-insensitive keys.
map
Constructor and Description |
---|
CaseInsensitiveMap()
Constructs a new empty case-insensitive map.
|
CaseInsensitiveMap(Map<String,V> map)
Wraps an existing map with a new case insensitive map.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all of the mappings from the map.
|
boolean |
containsKey(Object key)
Returns
true if this map contains a mapping for the specified
key. |
V |
get(Object key)
Returns the value to which the specified key is mapped, or
null
if the map contains no mapping for the key. |
V |
put(String key,
V value)
Associates the specified value with the specified key in the map.
|
void |
putAll(Map<? extends String,? extends V> m)
Copies all of the mappings from the specified map to the map.
|
V |
remove(Object key)
Removes the mapping for a key from the map if it is present.
|
void |
sync()
Synchronizes the keys of this case insensitive map and those of the map it is wrapping.
|
containsValue, entrySet, equals, hashCode, isEmpty, keySet, size, values
public CaseInsensitiveMap()
HashMap
with default initial capacity and load factor.public CaseInsensitiveMap(Map<String,V> map)
map
- the map to wrap with a new case insensitive map.public void sync()
public void clear()
MapDecorator
public boolean containsKey(Object key)
MapDecorator
true
if this map contains a mapping for the specified
key.containsKey
in interface Map<String,V>
containsKey
in class MapDecorator<String,V>
key
- the key whose presence in this map is to be tested.true
if this map contains a mapping for the specified
key.public V put(String key, V value)
MapDecorator
public void putAll(Map<? extends String,? extends V> m)
MapDecorator
public V get(Object key)
MapDecorator
null
if the map contains no mapping for the key.public V remove(Object key)
MapDecorator
Copyright 2011-2015 ForgeRock AS.