Package org.aoju.bus.core.map
Class TransitionMap<K,V>
java.lang.Object
org.aoju.bus.core.map.MapWrapper<K,V>
org.aoju.bus.core.map.TransitionMap<K,V>
- Type Parameters:
K- 键类型V- 值类型
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<Map.Entry<K,,V>> Map<K,,V> XWrapper<Map<K,V>>
- Direct Known Subclasses:
CustomKeyMap,FuncMap
自定义键和值转换的的Map 继承此类后,通过实现
customKey(Object)和customValue(Object),按照给定规则加入到map或获取值。- Since:
- Java 17+
- Author:
- Kimi Liu
- See Also:
-
Nested Class Summary
-
Field Summary
Fields inherited from class org.aoju.bus.core.map.MapWrapper
DEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR -
Constructor Summary
ConstructorsConstructorDescriptionTransitionMap(Supplier<Map<K, V>> mapFactory) 构造 通过传入一个Map从而确定Map的类型,子类需创建一个空的Map,而非传入一个已有Map,否则值可能会被修改TransitionMap(Map<K, V> emptyMap) 构造 通过传入一个Map从而确定Map的类型,子类需创建一个空的Map,而非传入一个已有Map,否则值可能会被修改 -
Method Summary
Modifier and TypeMethodDescriptioncomputeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction) computeIfPresent(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) booleancontainsKey(Object key) protected abstract K自定义键protected abstract VcustomValue(Object value) 自定义值getOrDefault(Object key, V defaultValue) voidputIfAbsent(K key, V value) booleanbooleanMethods inherited from class org.aoju.bus.core.map.MapWrapper
clear, clone, containsValue, entrySet, equals, forEach, getRaw, hashCode, isEmpty, iterator, keySet, replaceAll, size, toString, valuesMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
TransitionMap
-
TransitionMap
-
-
Method Details
-
get
-
put
-
putAll
-
containsKey
- Specified by:
containsKeyin interfaceMap<K,V> - Overrides:
containsKeyin classMapWrapper<K,V>
-
remove
-
remove
-
replace
-
replace
-
getOrDefault
- Specified by:
getOrDefaultin interfaceMap<K,V> - Overrides:
getOrDefaultin classMapWrapper<K,V>
-
computeIfPresent
- Specified by:
computeIfPresentin interfaceMap<K,V> - Overrides:
computeIfPresentin classMapWrapper<K,V>
-
compute
-
merge
-
putIfAbsent
- Specified by:
putIfAbsentin interfaceMap<K,V> - Overrides:
putIfAbsentin classMapWrapper<K,V>
-
computeIfAbsent
- Specified by:
computeIfAbsentin interfaceMap<K,V> - Overrides:
computeIfAbsentin classMapWrapper<K,V>
-
customKey
-
customValue
-