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.GsonJSON
-
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 voidclear()booleancontainsKey(Object key)booleancontainsValue(Object value)Set<Map.Entry<String,Object>>entrySet()Objectget(Object key)ObjectgetItem(String inPath)get item from a path separeted by '.'JSONMapgetMap(Object key)<T> TgetValue(Object key, Class<T> classOfT)<T> TgetValue(Object key, Type typeOfT)booleanisEmpty()Set<String>keySet()static Objectparse(String jsonStr)static JSONMapparseMap(String jsonStr)Objectput(String key, Object value)voidputAll(Map<? extends String,? extends Object> m)Objectremove(Object key)intsize()static Objecttransform(com.google.gson.JsonElement element)static JSONMaptransformMap(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:
containsKeyin interfaceMap<String,Object>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValuein 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.
-
-