-
- All Implemented Interfaces:
-
java.io.Serializable,kotlin.Cloneable,kotlin.collections.Map,kotlin.collections.MutableMap
public final class KuzzleMap extends HashMap<String, Any>
KuzzleMap is a Class that extends Map to be ThreadSafe and that has the purpose of giving a wrapper on top of Map to easily manipulate them.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classKuzzleMap.Companion
-
Method Summary
Modifier and Type Method Description final KuzzleMapput(String s, Object o)Objectget(String key)final BooleanisNull(String key)Check whether the key value is null or not. final BooleanisString(String key)Check whether the key value is a String or not. final BooleanisBoolean(String key)Check whether the key value is a Boolean or not. final BooleanisNumber(String key)Check whether the key value is a Number or not. final BooleanisArrayList(String key)Check whether the key value is an ArrayList or not. final BooleanisMap(String key)Check whether the key value is a Map or not. final StringgetString(String key)Return the specified key value or null if the value is not a String. final BooleangetBoolean(String key)Return the specified key value or null if the value is not a Boolean. final NumbergetNumber(String key)Return the specified key value or null if the value is not a Number. final ArrayList<?>getArrayList(String key)Return the specified key value or null if the value is not an ArrayList. final KuzzleMapgetMap(String key)Return the specified key value or null if the value is not a Map. final StringoptString(String key, String def)Return the specified key value or the def value if the value is nul or not a String. final BooleanoptBoolean(String key, Boolean def)Return the specified key value or the def value if the value is nul or not a Boolean. final NumberoptNumber(String key, Number def)Return the specified key value or the def value if the value is nul or not a Number. final ArrayList<?>optArrayList(String key, ArrayList<?> def)Return the specified key value or the def value if the value is nul or not an ArrayList. final KuzzleMapoptMap(String key, Map<String, Object> def)Return the specified key value or the def value if the value is nul or not a Map. -
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, forEach, getEntries, getKeys, getOrDefault, getSize, getValues, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll -
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
isNull
final Boolean isNull(String key)
Check whether the key value is null or not.
- Parameters:
key- a String representing the key.
-
isString
final Boolean isString(String key)
Check whether the key value is a String or not.
- Parameters:
key- a String representing the key.
-
isBoolean
final Boolean isBoolean(String key)
Check whether the key value is a Boolean or not.
- Parameters:
key- a String representing the key.
-
isNumber
final Boolean isNumber(String key)
Check whether the key value is a Number or not.
- Parameters:
key- a String representing the key.
-
isArrayList
final Boolean isArrayList(String key)
Check whether the key value is an ArrayList or not.
- Parameters:
key- a String representing the key.
-
isMap
final Boolean isMap(String key)
Check whether the key value is a Map or not.
- Parameters:
key- a String representing the key.
-
getString
final String getString(String key)
Return the specified key value or null if the value is not a String.
- Parameters:
key- a String representing the key.
-
getBoolean
final Boolean getBoolean(String key)
Return the specified key value or null if the value is not a Boolean.
- Parameters:
key- a String representing the key.
-
getNumber
final Number getNumber(String key)
Return the specified key value or null if the value is not a Number.
- Parameters:
key- a String representing the key.
-
getArrayList
final ArrayList<?> getArrayList(String key)
Return the specified key value or null if the value is not an ArrayList.
- Parameters:
key- a String representing the key.
-
getMap
final KuzzleMap getMap(String key)
Return the specified key value or null if the value is not a Map.
- Parameters:
key- a String representing the key.
-
optString
final String optString(String key, String def)
Return the specified key value or the def value if the value is nul or not a String.
- Parameters:
key- a String representing the key.
-
optBoolean
final Boolean optBoolean(String key, Boolean def)
Return the specified key value or the def value if the value is nul or not a Boolean.
- Parameters:
key- a String representing the key.
-
optNumber
final Number optNumber(String key, Number def)
Return the specified key value or the def value if the value is nul or not a Number.
- Parameters:
key- a String representing the key.
-
optArrayList
final ArrayList<?> optArrayList(String key, ArrayList<?> def)
Return the specified key value or the def value if the value is nul or not an ArrayList.
- Parameters:
key- a String representing the key.
-
-
-
-