Package org.aoju.bus.setting.metric
Class GroupMap
- All Implemented Interfaces:
Serializable,Cloneable,Map<String,LinkedHashMap<String, String>>
基于分组的Map
- Since:
- Java 17+
- Author:
- Kimi Liu
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription清除指定分组下的所有键值对booleancontainsKey(String group, String key) 指定分组中是否包含指定keybooleancontainsValue(String group, String value) 指定分组中是否包含指定值指定分组下所有键值对获取分组对应的值,如果分组不存在或者值不存在则返回nullbooleanisEmpty()是否为空,如果多个分组同时为空,也按照空处理boolean某个分组对应的键值对是否为空指定分组所有键的Set将键值对加入到对应分组中加入多个键值对到某个分组下从指定分组中删除指定值intsize()总的键值对数指定分组下所有值Methods inherited from class java.util.LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, valuesMethods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, merge, put, putAll, putIfAbsent, remove, remove, replace, replaceMethods inherited from class java.util.AbstractMap
equals, hashCode, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, merge, put, putAll, putIfAbsent, remove, remove, replace, replace
-
Constructor Details
-
GroupMap
public GroupMap()
-
-
Method Details
-
get
获取分组对应的值,如果分组不存在或者值不存在则返回null- Parameters:
group- 分组key- 键- Returns:
- 值, 如果分组不存在或者值不存在则返回null
-
size
public int size()总的键值对数 -
put
将键值对加入到对应分组中- Parameters:
group- 分组key- 键value- 值- Returns:
- 此key之前存在的值, 如果没有返回null
-
putAll
加入多个键值对到某个分组下- Parameters:
group- 分组m- 键值对- Returns:
- this
-
remove
从指定分组中删除指定值- Parameters:
group- 分组key- 键- Returns:
- 被删除的值, 如果值不存在, 返回null
-
isEmpty
某个分组对应的键值对是否为空- Parameters:
group- 分组- Returns:
- 是否为空
-
isEmpty
public boolean isEmpty()是否为空,如果多个分组同时为空,也按照空处理 -
containsKey
指定分组中是否包含指定key- Parameters:
group- 分组key- 键- Returns:
- 是否包含key
-
containsValue
指定分组中是否包含指定值- Parameters:
group- 分组value- 值- Returns:
- 是否包含值
-
clear
清除指定分组下的所有键值对- Parameters:
group- 分组- Returns:
- this
-
keySet
指定分组所有键的Set- Parameters:
group- 分组- Returns:
- 键Set
-
values
指定分组下所有值- Parameters:
group- 分组- Returns:
- 值
-
entrySet
指定分组下所有键值对- Parameters:
group- 分组- Returns:
- 键值对
-