Package org.aoju.bus.core.map
Class FuncMap<K,V>
java.lang.Object
org.aoju.bus.core.map.MapWrapper<K,V>
org.aoju.bus.core.map.TransitionMap<K,V>
org.aoju.bus.core.map.FuncMap<K,V>
- Type Parameters:
K- 键类型V- 值类型
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<Map.Entry<K,,V>> Map<K,,V> XWrapper<Map<K,V>>
自定义键值函数风格的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
Constructors -
Method Summary
Methods inherited from class org.aoju.bus.core.map.TransitionMap
compute, computeIfAbsent, computeIfPresent, containsKey, get, getOrDefault, merge, put, putAll, putIfAbsent, remove, remove, replace, replaceMethods 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
-
FuncMap
public FuncMap(Supplier<Map<K, V>> mapFactory, Function<Object, K> keyFunc, Function<Object, V> valueFunc) 构造
注意提供的Map中不能有键值对,否则可能导致自定义key失效- Parameters:
mapFactory- Map,提供的空mapkeyFunc- 自定义KEY的函数valueFunc- 自定义value函数
-
FuncMap
构造
注意提供的Map中不能有键值对,否则可能导致自定义key失效- Parameters:
emptyMap- Map,提供的空mapkeyFunc- 自定义KEY的函数valueFunc- 自定义value函数
-
-
Method Details
-
customKey
根据函数自定义键- Specified by:
customKeyin classTransitionMap<K,V> - Parameters:
key- KEY- Returns:
- 驼峰Key
-
customValue
Description copied from class:TransitionMap自定义值- Specified by:
customValuein classTransitionMap<K,V> - Parameters:
value- 值- Returns:
- 自定义值
-