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) classNested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs an emptyCaseAwareLinkedMapinstance withLocale.ENGLISH.CaseAwareLinkedMap(Locale locale) Constructs an emptyCaseAwareLinkedMapinstance with the specifiedLocale.CaseAwareLinkedMap(CommandLine.Model.CaseAwareLinkedMap<? extends K, ? extends V> map) Constructs aCaseAwareLinkedMapinstance with the same mappings, case-sensitivity and locale as the specified map. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key) booleancontainsValue(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 booleanisCaseConvertible(Class<?> clazz) booleanReturns the case-insensitivity of the map.keySet()voidsetCaseInsensitive(boolean caseInsensitive) Sets the case-insensitivity of the map.intsize()private KtoLowerCase(Object caseSensitiveKey) values()Methods inherited from class java.util.AbstractMap
clone, equals, hashCode, isEmpty, putAll, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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 emptyCaseAwareLinkedMapinstance withLocale.ENGLISH. -
CaseAwareLinkedMap
Constructs an emptyCaseAwareLinkedMapinstance with the specifiedLocale.- Parameters:
locale- the locale to convert character cases
-
CaseAwareLinkedMap
Constructs aCaseAwareLinkedMapinstance 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:
containsKeyin interfaceMap<K,V> - Overrides:
containsKeyin classAbstractMap<K,V>
-
containsValue
- Specified by:
containsValuein interfaceMap<K,V> - Overrides:
containsValuein classAbstractMap<K,V>
-
get
-
put
-
remove
-
clear
public void clear() -
keySet
-
values
-
entrySet
-