Class BasicRowProcessor.CaseInsensitiveHashMap
java.lang.Object
java.util.AbstractMap<String,Object>
java.util.HashMap<String,Object>
java.util.LinkedHashMap<String,Object>
org.apache.commons.dbutils.BasicRowProcessor.CaseInsensitiveHashMap
- All Implemented Interfaces:
Serializable, Cloneable, Map<String,Object>
- Enclosing class:
BasicRowProcessor
private static final class BasicRowProcessor.CaseInsensitiveHashMap
extends LinkedHashMap<String,Object>
A Map that converts all keys to lowercase Strings for case insensitive
lookups. This is needed for the toMap() implementation because
databases don't consistently handle the casing of column names.
The keys are stored as they are given [BUG #DBUTILS-34], so we maintain an internal mapping from lowercase keys to the real keys in order to achieve the case insensitive lookup.
Note: This implementation does not allow null
for key, whereas LinkedHashMap does, because of the code:
key.toString().toLowerCase()
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
FieldsModifier and TypeFieldDescriptionThe internal mapping from lowercase keys to the real keys.private static final longRequired for serialization support. -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class LinkedHashMap
clear, containsValue, entrySet, forEach, getOrDefault, keySet, removeEldestEntry, replaceAll, valuesMethods inherited from class HashMap
clone, compute, computeIfAbsent, computeIfPresent, isEmpty, merge, putIfAbsent, remove, replace, replace, sizeMethods inherited from class AbstractMap
equals, hashCode, toStringMethods inherited from interface Map
compute, computeIfAbsent, computeIfPresent, equals, hashCode, isEmpty, merge, putIfAbsent, remove, replace, replace, size
-
Field Details
-
lowerCaseMap
The internal mapping from lowercase keys to the real keys.Any query operation using the key (
get(Object),containsKey(Object)) is done in three steps:- convert the parameter key to lower case
- get the actual key that corresponds to the lower case key
- query the map with the actual key
-
serialVersionUID
private static final long serialVersionUIDRequired for serialization support.- See Also:
-
-
Constructor Details
-
CaseInsensitiveHashMap
private CaseInsensitiveHashMap(int initialCapacity)
-
-
Method Details
-
containsKey
- Specified by:
containsKeyin interfaceMap<String,Object> - Overrides:
containsKeyin classHashMap<String,Object>
-
get
-
put
-
putAll
-
remove
-