Package picocli
Class CommandLine.Model.CaseAwareLinkedMap<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
picocli.CommandLine.Model.CaseAwareLinkedMap<K,V>
- Type Parameters:
V
- type of the value
- All Implemented Interfaces:
Map<K,
V>
- Enclosing class:
CommandLine.Model
This class provides a case-aware Linked HashMap. Supports both case-sensitive and case-insensitive modes.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs an emptyCaseAwareLinkedMap
instance withLocale.ENGLISH
.CaseAwareLinkedMap
(Locale locale) Constructs an emptyCaseAwareLinkedMap
instance with the specifiedLocale
.CaseAwareLinkedMap
(CommandLine.Model.CaseAwareLinkedMap<? extends K, ? extends V> map) Constructs aCaseAwareLinkedMap
instance with the same mappings, case-sensitivity and locale as the specified map. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
boolean
containsKey
(Object key) boolean
containsValue
(Object value) entrySet()
getCaseSensitiveKey
(K caseInsensitiveKey) Returns the case-sensitive key of the specified case-insensitive key ifisCaseSensitive()
.Returns the locale of the map.(package private) static boolean
isCaseConvertible
(Class<?> clazz) boolean
Returns the case-insensitivity of the map.keySet()
void
setCaseInsensitive
(boolean caseInsensitive) Sets the case-insensitivity of the map.int
size()
private K
toLowerCase
(Object caseSensitiveKey) values()
Methods inherited from class java.util.AbstractMap
clone, equals, hashCode, isEmpty, putAll, toString
Methods inherited from class java.lang.Object
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
-
Field Details
-
targetMap
-
keyMap
-
keySet
-
caseInsensitive
private boolean caseInsensitive -
locale
-
-
Constructor Details
-
CaseAwareLinkedMap
public CaseAwareLinkedMap()Constructs an emptyCaseAwareLinkedMap
instance withLocale.ENGLISH
. -
CaseAwareLinkedMap
Constructs an emptyCaseAwareLinkedMap
instance with the specifiedLocale
.- Parameters:
locale
- the locale to convert character cases
-
CaseAwareLinkedMap
Constructs aCaseAwareLinkedMap
instance with the same mappings, case-sensitivity and locale as the specified map.- Parameters:
map
- the map whose mappings, case-sensitivity and locale are to be placed in this map- Throws:
NullPointerException
- if the specified map is null
-
-
Method Details
-
isCaseConvertible
-
toLowerCase
-
isCaseInsensitive
public boolean isCaseInsensitive()Returns the case-insensitivity of the map. -
setCaseInsensitive
public void setCaseInsensitive(boolean caseInsensitive) Sets the case-insensitivity of the map. -
getLocale
Returns the locale of the map. -
getCaseSensitiveKey
Returns the case-sensitive key of the specified case-insensitive key ifisCaseSensitive()
. Otherwise, the specified case-insensitive key is returned. -
size
public int size() -
containsKey
- Specified by:
containsKey
in interfaceMap<K,
V> - Overrides:
containsKey
in classAbstractMap<K,
V>
-
containsValue
- Specified by:
containsValue
in interfaceMap<K,
V> - Overrides:
containsValue
in classAbstractMap<K,
V>
-
get
-
put
-
remove
-
clear
public void clear() -
keySet
-
values
-
entrySet
-