public class VKJsonHelper
extends java.lang.Object
| Constructor and Description |
|---|
VKJsonHelper() |
| Modifier and Type | Method and Description |
|---|---|
static java.util.Map<java.lang.String,java.lang.Object> |
getMap(org.json.JSONObject object,
java.lang.String key)
Converts field in key to map
|
static boolean |
isEmptyObject(org.json.JSONObject object)
Check if json object is empty
|
static java.lang.Object |
toArray(org.json.JSONArray array,
java.lang.Class arrayClass) |
static java.lang.Object |
toJSON(java.lang.Object object)
Converts object to JSON object, if possible
|
static java.util.List |
toList(org.json.JSONArray array)
Converts json-array to list
|
static java.util.Map<java.lang.String,java.lang.Object> |
toMap(org.json.JSONObject object)
Converts selected json-object to map
|
public static java.lang.Object toJSON(java.lang.Object object)
throws org.json.JSONException
object - object to serialize to jsonorg.json.JSONExceptionpublic static boolean isEmptyObject(org.json.JSONObject object)
object - object to checkpublic static java.util.Map<java.lang.String,java.lang.Object> getMap(org.json.JSONObject object,
java.lang.String key)
throws org.json.JSONException
object - target objectkey - target keyorg.json.JSONExceptionpublic static java.util.Map<java.lang.String,java.lang.Object> toMap(org.json.JSONObject object)
throws org.json.JSONException
object - object to convertorg.json.JSONExceptionpublic static java.util.List toList(org.json.JSONArray array)
throws org.json.JSONException
array - json-array to convertorg.json.JSONExceptionpublic static java.lang.Object toArray(org.json.JSONArray array,
java.lang.Class arrayClass)