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 TypeMethodDescriptionboolean
containsKey
(Object key) boolean
containsValue
(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> T
Get a value from map.<T> T
Get a value from map.getValueOrDefault
(String key, List<T> defaultValue, Class<T> clazz) Get a value from map.getValueOrDefault
(String key, UUID defaultValue) <T> T
getValueOrDefault
(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> T
getValueOrDefault
(String key, T defaultValue, Function<String, T> valueConverter) Get a value from map.boolean
isEmpty()
keySet()
<T,
V> void int
size()
Methods inherited from class java.util.AbstractMap
clear, clone, equals, hashCode, put, putAll, remove, toString, values
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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 anMapEntry
object.- 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:
containsKey
in interfaceMap<String,
Object> - Overrides:
containsKey
in classAbstractMap<String,
Object>
-
containsValue
- Specified by:
containsValue
in interfaceMap<String,
Object> - Overrides:
containsValue
in classAbstractMap<String,
Object>
-
keySet
-