Class TypeResolvingMap
Map for type resolving.
- Since:
- 1.0.0
-
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> -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()Get a value from map.getMap(String key, BiFunction<String, V, K> keyOrValueToKey) Converts a map which was saved withSerializationUtil.Builder.addMap(String, Map, BiFunction))} to a map.<T> TGet a value from map.<T> TGet a value from map.getValueOrDefault(String key, List<T> defaultValue, Class<T> clazz) Get a value from map.getValueOrDefault(String key, UUID defaultValue) <T> TgetValueOrDefault(String key, T defaultValue) Get a value from map.<T extends Enum<T>>
TgetValueOrDefault(String key, T defaultValue, Class<T> clazz) Get a value from map.<T> TgetValueOrDefault(String key, T defaultValue, Function<String, T> valueConverter) Get a value from map.booleanisEmpty()keySet()<T,V> void intsize()Methods inherited from class java.util.AbstractMap
clear, clone, equals, hashCode, put, putAll, remove, toString, valuesMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Method Details
-
entrySet
-
get
Get a value from map. -
getValue
Get a value from map.- Type Parameters:
T- type of return value- Parameters:
key- key- Returns:
- object or null if key is not present
-
listToMap
-
getValueOrDefault
Get a value from map.- Type Parameters:
T- type of return value- Parameters:
key- keydefaultValue- default value if key does not exist- Returns:
- value of key or default value
-
getValueOrDefault
-
getValueOrDefault
public <T extends Enum<T>> T getValueOrDefault(String key, @Nullable T defaultValue, Class<T> clazz) Get a value from map.- Type Parameters:
T- type of return value- Parameters:
key- keydefaultValue- default value if key does not existclazz- enum clazz to resolve- Returns:
- value of key or default value
-
getValueOrDefault
public <T extends Enum<T>> List<T> getValueOrDefault(String key, List<T> defaultValue, Class<T> clazz) Get a value from map.- Type Parameters:
T- type of return value- Parameters:
key- keydefaultValue- default value if key does not existclazz- enum clazz to resolve- Returns:
- value of key or default value
-
getValueOrDefault
Get a value from map.- Type Parameters:
T- type of return value- Parameters:
key- keydefaultValue- default value if key does not existvalueConverter- Function to parse the string to value- Returns:
- value of key or default value
-
getMap
Converts a map which was saved withSerializationUtil.Builder.addMap(String, Map, BiFunction))} to a map. These objects will be wrapped into anMapEntryobject.- Type Parameters:
K- type of keyV- type of value- Parameters:
key- key of mapkeyOrValueToKey- function to map the key or the value to a key- Returns:
- map
- Since:
- 1.3.2
-
getValue
Get a value from map.- Type Parameters:
T- type of return value- Parameters:
key- keyvalueConverter- Function to parse the string to value.- Returns:
- converted string or null if key is not present.
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKeyin interfaceMap<String,Object> - Overrides:
containsKeyin classAbstractMap<String,Object>
-
containsValue
- Specified by:
containsValuein interfaceMap<String,Object> - Overrides:
containsValuein classAbstractMap<String,Object>
-
keySet
-