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:
java.util.Map<K,V>
- Enclosing class:
- CommandLine.Model
static class CommandLine.Model.CaseAwareLinkedMap<K,V> extends java.util.AbstractMap<K,V>This class provides a case-aware Linked HashMap. Supports both case-sensitive and case-insensitive modes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classCommandLine.Model.CaseAwareLinkedMap.CaseAwareKeySet
-
Constructor Summary
Constructors Constructor Description CaseAwareLinkedMap()Constructs an emptyCaseAwareLinkedMapinstance withLocale.ENGLISH.CaseAwareLinkedMap(java.util.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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()booleancontainsKey(java.lang.Object key)booleancontainsValue(java.lang.Object value)java.util.Set<java.util.Map.Entry<K,V>>entrySet()Vget(java.lang.Object key)KgetCaseSensitiveKey(K caseInsensitiveKey)Returns the case-sensitive key of the specified case-insensitive key ifisCaseSensitive().java.util.LocalegetLocale()Returns the locale of the map.(package private) static booleanisCaseConvertible(java.lang.Class<?> clazz)booleanisCaseInsensitive()Returns the case-insensitivity of the map.java.util.Set<K>keySet()Vput(K key, V value)Vremove(java.lang.Object key)voidsetCaseInsensitive(boolean caseInsensitive)Sets the case-insensitivity of the map.intsize()private KtoLowerCase(java.lang.Object caseSensitiveKey)java.util.Collection<V>values()-
Methods inherited from class java.util.AbstractMap
clone, equals, hashCode, isEmpty, putAll, toString
-
-
-
-
Constructor Detail
-
CaseAwareLinkedMap
public CaseAwareLinkedMap()
Constructs an emptyCaseAwareLinkedMapinstance withLocale.ENGLISH.
-
CaseAwareLinkedMap
public CaseAwareLinkedMap(java.util.Locale locale)
Constructs an emptyCaseAwareLinkedMapinstance with the specifiedLocale.- Parameters:
locale- the locale to convert character cases
-
CaseAwareLinkedMap
public CaseAwareLinkedMap(CommandLine.Model.CaseAwareLinkedMap<? extends K,? extends V> map)
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:
java.lang.NullPointerException- if the specified map is null
-
-
Method Detail
-
isCaseConvertible
static boolean isCaseConvertible(java.lang.Class<?> clazz)
-
toLowerCase
private K toLowerCase(java.lang.Object caseSensitiveKey)
-
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
public java.util.Locale getLocale()
Returns the locale of the map.
-
getCaseSensitiveKey
public K getCaseSensitiveKey(K caseInsensitiveKey)
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
public boolean containsKey(java.lang.Object key)
-
containsValue
public boolean containsValue(java.lang.Object value)
-
get
public V get(java.lang.Object key)
-
remove
public V remove(java.lang.Object key)
-
clear
public void clear()
-
keySet
public java.util.Set<K> keySet()
-
values
public java.util.Collection<V> values()
-
-