Package io.github.venkateshamurthy.enums
Class DynamicEnumMap<K extends DynamicEnum<K>,V>
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap<K,V>
io.github.venkateshamurthy.enums.DynamicEnumMap<K,V>
- Type Parameters:
K- key which is of the form K extends DynamicEnum<K>V- value
- All Implemented Interfaces:
Serializable,Cloneable,Map<K,V>
A Map<DynamicEnum<K>, V> along the lines of EnumMap.
- 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 TypeMethodDescriptionA fluent method to put key value pair to the mapcomputeIfAbsent(K k, Function<? super K, ? extends V> remappingFunction) computeIfPresent(K k, BiFunction<? super K, ? super V, ? extends V> remappingFunction) static <A extends DynamicEnum<A>,B>
DynamicEnumMap<A,B> Creates aDynamicEnumMapstatic <A extends DynamicEnum<A>,B>
DynamicEnumMap<A,B> Creates aDynamicEnumMapstatic <A extends DynamicEnum<A>,B>
DynamicEnumMap<A,B> Creates aDynamicEnumMapputIfAbsent(K k, V v) booleanMethods inherited from class java.util.LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, valuesMethods inherited from class java.util.HashMap
clone, containsKey, isEmpty, putAll, remove, remove, sizeMethods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Constructor Details
-
DynamicEnumMap
public DynamicEnumMap()
-
-
Method Details
-
of
Creates aDynamicEnumMap- Type Parameters:
A- keu typeB- value type- Parameters:
cls- is Class<A>a- instance of type Ab- instance of type B- Returns:
- DynamicEnumMap
-
of
public static <A extends DynamicEnum<A>,B> DynamicEnumMap<A,B> of(Class<A> cls, A a1, B b1, A a2, B b2) Creates aDynamicEnumMap- Type Parameters:
A- keu typeB- value type- Parameters:
cls- is Class<A>a1- instance of type Ab1- instance of type Ba2- instance of type Ab2- instance of type B- Returns:
- DynamicEnumMap
-
of
public static <A extends DynamicEnum<A>,B> DynamicEnumMap<A,B> of(Class<A> cls, A a1, B b1, A a2, B b2, A a3, B b3) Creates aDynamicEnumMap- Type Parameters:
A- keu typeB- value type- Parameters:
cls- is Class<A>a1- instance of type Ab1- instance of type Ba2- instance of type Ab2- instance of type Ba3- instance of type Ab3- instance of type B- Returns:
- DynamicEnumMap
-
replace
-
replace
-
merge
-
computeIfAbsent
- Specified by:
computeIfAbsentin interfaceMap<K extends DynamicEnum<K>,V> - Overrides:
computeIfAbsentin classHashMap<K extends DynamicEnum<K>,V>
-
computeIfPresent
- Specified by:
computeIfPresentin interfaceMap<K extends DynamicEnum<K>,V> - Overrides:
computeIfPresentin classHashMap<K extends DynamicEnum<K>,V>
-
compute
-
putIfAbsent
- Specified by:
putIfAbsentin interfaceMap<K extends DynamicEnum<K>,V> - Overrides:
putIfAbsentin classHashMap<K extends DynamicEnum<K>,V>
-
put
-
add
A fluent method to put key value pair to the map- Parameters:
k- keyv- value- Returns:
- this
-