Package org.javlo.utils
Class JSONMap
- java.lang.Object
-
- org.javlo.utils.JSONMap
-
-
Field Summary
Fields Modifier and Type Field Description static com.google.gson.Gson
JSON
-
Constructor Summary
Constructors Constructor Description JSONMap(com.google.gson.JsonObject object)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
boolean
containsKey(Object key)
boolean
containsValue(Object value)
Set<Map.Entry<String,Object>>
entrySet()
Object
get(Object key)
Object
getItem(String inPath)
get item from a path separeted by '.'JSONMap
getMap(Object key)
<T> T
getValue(Object key, Class<T> classOfT)
<T> T
getValue(Object key, Type typeOfT)
boolean
isEmpty()
Set<String>
keySet()
static Object
parse(String jsonStr)
static JSONMap
parseMap(String jsonStr)
Object
put(String key, Object value)
void
putAll(Map<? extends String,? extends Object> m)
Object
remove(Object key)
int
size()
static Object
transform(com.google.gson.JsonElement element)
static JSONMap
transformMap(com.google.gson.JsonElement element)
Collection<Object>
values()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Method Detail
-
transformMap
public static JSONMap transformMap(com.google.gson.JsonElement element)
-
transform
public static Object transform(com.google.gson.JsonElement element)
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey
in interfaceMap<String,Object>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValue
in interfaceMap<String,Object>
-
getItem
public Object getItem(String inPath)
get item from a path separeted by '.'- Parameters:
path
- path to item like 'parent1.parent2.2.key, number in index is array- Returns:
- null if not found.
-
-