类 LinkedCaseInsensitiveMap<V>
java.lang.Object
cn.taketoday.util.LinkedCaseInsensitiveMap<V>
- 类型参数:
V- the value type
- 所有已实现的接口:
Serializable,Cloneable,Map<String,V>
public class LinkedCaseInsensitiveMap<V>
extends Object
implements Map<String,V>, Serializable, Cloneable
LinkedHashMap variant that stores String keys in a case-insensitive
manner, for example for key-based access in a results table.
Preserves the original order as well as the original casing of keys, while allowing for contains, get and remove calls with any case of key.
Does not support null keys.
- 从以下版本开始:
- 2019-12-08 20:20
- 作者:
- Juergen Hoeller, Phillip Webb, Harry Yang
- 另请参阅:
-
嵌套类概要
嵌套类修饰符和类型类说明private classprivate classprivate classprivate classprivate classprivate classprivate class -
字段概要
字段 -
构造器概要
构造器限定符构造器说明Create a new LinkedCaseInsensitiveMap that stores case-insensitive keys according to the default Locale (by default in lower case).LinkedCaseInsensitiveMap(int expectedSize) Create a new LinkedCaseInsensitiveMap that wraps aLinkedHashMapwith an initial capacity that can accommodate the specified number of elements without any immediate resize/rehash operations to be expected, storing case-insensitive keys according to the default Locale (in lower case).LinkedCaseInsensitiveMap(int expectedSize, Locale locale) Create a new LinkedCaseInsensitiveMap that wraps aLinkedHashMapwith an initial capacity that can accommodate the specified number of elements without any immediate resize/rehash operations to be expected, storing case-insensitive keys according to the given Locale (in lower case).privateCopy constructor.LinkedCaseInsensitiveMap(Locale locale) Create a new LinkedCaseInsensitiveMap that stores case-insensitive keys according to the given Locale (in lower case). -
方法概要
修饰符和类型方法说明voidclear()clone()computeIfAbsent(String key, Function<? super String, ? extends V> mappingFunction) booleancontainsKey(Object key) booleancontainsValue(Object value) protected StringconvertKey(String key) Convert the given key to a case-insensitive key.entrySet()booleanvoidforEach(BiConsumer<? super String, ? super V> action) Return the locale used by thisLinkedCaseInsensitiveMap.getOrDefault(Object key, V defaultValue) inthashCode()booleanisEmpty()keySet()voidputIfAbsent(String key, V value) private Stringprotected booleanremoveEldestEntry(Map.Entry<String, V> eldest) Determine whether this map should remove the given eldest entry.intsize()toString()values()从接口继承的方法 java.util.Map
compute, computeIfPresent, merge, remove, replace, replace, replaceAll
-
字段详细资料
-
serialVersionUID
private static final long serialVersionUID- 另请参阅:
-
targetMap
-
caseInsensitiveKeys
-
locale
-
keySet
-
values
-
entrySet
-
-
构造器详细资料
-
LinkedCaseInsensitiveMap
public LinkedCaseInsensitiveMap()Create a new LinkedCaseInsensitiveMap that stores case-insensitive keys according to the default Locale (by default in lower case).- 另请参阅:
-
LinkedCaseInsensitiveMap
Create a new LinkedCaseInsensitiveMap that stores case-insensitive keys according to the given Locale (in lower case).- 参数:
locale- the Locale to use for case-insensitive key conversion- 另请参阅:
-
LinkedCaseInsensitiveMap
public LinkedCaseInsensitiveMap(int expectedSize) Create a new LinkedCaseInsensitiveMap that wraps aLinkedHashMapwith an initial capacity that can accommodate the specified number of elements without any immediate resize/rehash operations to be expected, storing case-insensitive keys according to the default Locale (in lower case).- 参数:
expectedSize- the expected number of elements (with a corresponding capacity to be derived so that no resize/rehash operations are needed)- 另请参阅:
-
LinkedCaseInsensitiveMap
Create a new LinkedCaseInsensitiveMap that wraps aLinkedHashMapwith an initial capacity that can accommodate the specified number of elements without any immediate resize/rehash operations to be expected, storing case-insensitive keys according to the given Locale (in lower case).- 参数:
expectedSize- the expected number of elements (with a corresponding capacity to be derived so that no resize/rehash operations are needed)locale- the Locale to use for case-insensitive key conversion- 另请参阅:
-
LinkedCaseInsensitiveMap
Copy constructor.
-
-
方法详细资料
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- 指定者:
containsKey在接口中Map<String,V>
-
containsValue
- 指定者:
containsValue在接口中Map<String,V>
-
get
-
getOrDefault
- 指定者:
getOrDefault在接口中Map<String,V>
-
put
-
putAll
-
putIfAbsent
- 指定者:
putIfAbsent在接口中Map<String,V>
-
computeIfAbsent
@Nullable public V computeIfAbsent(String key, Function<? super String, ? extends V> mappingFunction) - 指定者:
computeIfAbsent在接口中Map<String,V>
-
remove
-
clear
public void clear() -
keySet
-
values
-
entrySet
-
forEach
-
clone
-
equals
-
hashCode
public int hashCode() -
toString
-
getLocale
Return the locale used by thisLinkedCaseInsensitiveMap. Used for case-insensitive key conversion. -
convertKey
Convert the given key to a case-insensitive key.The default implementation converts the key to lower-case according to this Map's Locale.
- 参数:
key- the user-specified key- 返回:
- the key to use for storing
- 另请参阅:
-
removeEldestEntry
Determine whether this map should remove the given eldest entry.- 参数:
eldest- the candidate entry- 返回:
truefor removing it,falsefor keeping it- 另请参阅:
-
removeCaseInsensitiveKey
-