Class CaseInsensitiveMap<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap<K,V>
com.sure.tool.collection.CaseInsensitiveMap<K,V>
- Type Parameters:
K- key 类型V- value 类型
- All Implemented Interfaces:
Serializable, Cloneable, Map<K,V>, SequencedMap<K, V>
大小写不敏感的 Map,继承
LinkedHashMap 保持插入顺序,参考 Hutool 的 CaseInsensitiveMap 设计。
键以字符串形式归一化为小写存储:put("Key", 1) 与 put("key", 2) 视为同一键(后者覆盖)。
null 键仅允许一个且不适用大小写规则。
- Since:
- 0.1.0
- Author:
- suretool
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
ConstructorsConstructorDescription创建空 Map。CaseInsensitiveMap(int initialCapacity) 创建带初始容量的 Map。CaseInsensitiveMap(Map<? extends K, ? extends V> map) 从既有 Map 创建(键冲突时后者覆盖)。 -
Method Summary
Methods inherited from class LinkedHashMap
clear, containsValue, entrySet, forEach, getOrDefault, keySet, newLinkedHashMap, putFirst, putLast, removeEldestEntry, replaceAll, reversed, sequencedEntrySet, sequencedKeySet, sequencedValues, valuesMethods inherited from class HashMap
clone, compute, computeIfAbsent, computeIfPresent, isEmpty, merge, newHashMap, putIfAbsent, remove, replace, replace, sizeMethods inherited from class AbstractMap
equals, hashCode, toStringMethods inherited from interface Map
compute, computeIfAbsent, computeIfPresent, equals, hashCode, isEmpty, merge, putIfAbsent, remove, replace, replace, sizeMethods inherited from interface SequencedMap
firstEntry, lastEntry, pollFirstEntry, pollLastEntry
-
Constructor Details
-
CaseInsensitiveMap
public CaseInsensitiveMap()创建空 Map。 -
CaseInsensitiveMap
public CaseInsensitiveMap(int initialCapacity) 创建带初始容量的 Map。- Parameters:
initialCapacity- 初始容量
-
CaseInsensitiveMap
-
-
Method Details
-
put
-
putAll
-
get
-
containsKey
- Specified by:
containsKeyin interfaceMap<K,V> - Overrides:
containsKeyin classHashMap<K,V>
-
remove
-