Package org.apache.drill.common.map
Class CaseInsensitiveMap<VALUE>
java.lang.Object
org.apache.drill.common.map.CaseInsensitiveMap<VALUE>
- Type Parameters:
VALUE- the type of values to be stored in the map
A special type of
Map with Strings as keys, and the case of a key is ignored for operations involving
keys like put(java.lang.String, VALUE), get(java.lang.Object), etc. The keys are stored and retrieved in lower case. Use the static factory
methods to create instances of this class (e.g. newConcurrentMap()).-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()booleaninthashCode()booleanisEmpty()keySet()static <VALUE> CaseInsensitiveMap<VALUE> Returns a new instance ofConcurrentMapwith key case-insensitivity.static <VALUE> CaseInsensitiveMap<VALUE> Returns a new instance ofHashMapwith key case-insensitivity.static <VALUE> CaseInsensitiveMap<VALUE> newHashMapWithExpectedSize(int expectedSize) Returns a new instance ofHashMap, with key case-insensitivity, of expected size.static <VALUE> CaseInsensitiveMap<VALUE> newImmutableMap(Map<? extends String, ? extends VALUE> map) Returns a new instance ofImmutableMapwith key case-insensitivity.voidintsize()toString()values()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Method Details
-
newConcurrentMap
Returns a new instance ofConcurrentMapwith key case-insensitivity. SeeConcurrentMap.- Type Parameters:
VALUE- type of values to be stored in the map- Returns:
- key case-insensitive concurrent map
-
newHashMap
- Type Parameters:
VALUE- type of values to be stored in the map- Returns:
- key case-insensitive hash map
-
newHashMapWithExpectedSize
- Type Parameters:
VALUE- type of values to be stored in the map- Parameters:
expectedSize- expected size- Returns:
- key case-insensitive hash map
-
newImmutableMap
public static <VALUE> CaseInsensitiveMap<VALUE> newImmutableMap(Map<? extends String, ? extends VALUE> map) Returns a new instance ofImmutableMapwith key case-insensitivity. This map is built from the given map. SeeImmutableMap.- Type Parameters:
VALUE- type of values to be stored in the map- Parameters:
map- map to copy from- Returns:
- key case-insensitive immutable map
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKeyin interfaceMap<String,VALUE>
-
containsValue
- Specified by:
containsValuein interfaceMap<String,VALUE>
-
get
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-
hashCode
public int hashCode() -
equals
-
toString
-