org.apache.camel.util
Class CaseInsensitiveMap
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<String,Object>
org.apache.camel.util.CaseInsensitiveMap
- All Implemented Interfaces:
- Serializable, Cloneable, Map<String,Object>
public class CaseInsensitiveMap
- extends HashMap<String,Object>
A map that uses case insensitive keys, but preserves the original keys in the keySet.
This map allows you to do lookup using case insensitive keys so you can retrieve the value without worrying about
whether some transport protocol affects the keys such as Http and Mail protocols can do.
When copying from this map to a regular Map such as HashMap
then the original keys are
copied over and you get the old behavior back using a regular Map with case sensitive keys.
This map is not designed to be thread safe as concurrent access to it is not supposed to be performed
by the Camel routing engine.
- Version:
- See Also:
- Serialized Form
CaseInsensitiveMap
public CaseInsensitiveMap()
CaseInsensitiveMap
public CaseInsensitiveMap(Map<? extends String,?> map)
CaseInsensitiveMap
public CaseInsensitiveMap(int initialCapacity,
float loadFactor)
CaseInsensitiveMap
public CaseInsensitiveMap(int initialCapacity)
get
public Object get(Object key)
- Specified by:
get
in interface Map<String,Object>
- Overrides:
get
in class HashMap<String,Object>
put
public Object put(String key,
Object value)
- Specified by:
put
in interface Map<String,Object>
- Overrides:
put
in class HashMap<String,Object>
putAll
public void putAll(Map<? extends String,?> map)
- Specified by:
putAll
in interface Map<String,Object>
- Overrides:
putAll
in class HashMap<String,Object>
remove
public Object remove(Object key)
- Specified by:
remove
in interface Map<String,Object>
- Overrides:
remove
in class HashMap<String,Object>
clear
public void clear()
- Specified by:
clear
in interface Map<String,Object>
- Overrides:
clear
in class HashMap<String,Object>
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey
in interface Map<String,Object>
- Overrides:
containsKey
in class HashMap<String,Object>
entrySet
public Set<Map.Entry<String,Object>> entrySet()
- Specified by:
entrySet
in interface Map<String,Object>
- Overrides:
entrySet
in class HashMap<String,Object>
Apache CAMEL