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 String
s 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 TypeMethodDescriptionvoid
clear()
boolean
containsKey
(Object key) boolean
containsValue
(Object value) entrySet()
boolean
int
hashCode()
boolean
isEmpty()
keySet()
static <VALUE> CaseInsensitiveMap<VALUE>
Returns a new instance ofConcurrentMap
with key case-insensitivity.static <VALUE> CaseInsensitiveMap<VALUE>
Returns a new instance ofHashMap
with 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 ofImmutableMap
with key case-insensitivity.void
int
size()
toString()
values()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Method Details
-
newConcurrentMap
Returns a new instance ofConcurrentMap
with 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 ofImmutableMap
with 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:
containsKey
in interfaceMap<String,
VALUE>
-
containsValue
- Specified by:
containsValue
in interfaceMap<String,
VALUE>
-
get
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-
hashCode
public int hashCode() -
equals
-
toString
-