Class CaseInsensitiveMap
- All Implemented Interfaces:
Serializable, Map<String,Object>
A map that uses case insensitive keys, but preserves the original key cases.
The map uses a custom hash table with case-insensitive hashing and comparison, providing O(1) for
get,
put, containsKey and remove operations without allocating temporary strings. Entries are
stored in insertion order.
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.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()booleanisEmpty()voidstatic voidregisterKnownKeys(Collection<String> keys) Registers a set of well-known header key strings for deduplication.intsize()Methods inherited from interface Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
CaseInsensitiveMap
public CaseInsensitiveMap() -
CaseInsensitiveMap
-
-
Method Details
-
registerKnownKeys
Registers a set of well-known header key strings for deduplication. When a key passed toput(String, Object)matches one of these strings (case-insensitive), the canonical reference from this set is stored instead of the caller's string, reducing memory when many map instances carry the same headers (e.g. deserialized exchanges). This method is intended to be called once during framework startup. -
get
-
containsKey
- Specified by:
containsKeyin interfaceMap<String,Object> - Overrides:
containsKeyin classAbstractMap<String,Object>
-
containsValue
- Specified by:
containsValuein interfaceMap<String,Object> - Overrides:
containsValuein classAbstractMap<String,Object>
-
put
-
remove
-
size
-
isEmpty
-
clear
-
putAll
-
entrySet
-