public final class JSONArray extends JSON
Constructor and Description |
---|
JSONArray() |
Modifier and Type | Method and Description |
---|---|
static JSONArray |
createArray(boolean[] arr) |
static JSONArray |
createArray(double[] arr) |
static JSONArray |
createArray(int[] arr) |
static JSONArray |
createArray(JSON[] arr) |
void |
deleteItemFromArray(int index)
Delete an item in JSON object
|
JSON |
detachItemFromArray(int index)
Detach an item from JSON array
|
JSON |
getArrayItem(int index)
Returns the array item as a new JSON object.
|
int |
getSize()
Checks if the item is an array and returns its size
|
int |
getType() |
static JSON |
parse(byte[] jsonBuffer) |
static JSON |
parse(java.lang.String jsonString) |
java.lang.String |
serialize()
Serializes the JSON object to a String, for instance to be sent over MQTT.
|
java.lang.String |
serializeMinify()
Serializes the JSON object to a String, for instance, to be sent over MQTT.
|
add, add, add, add, add, addBool, addDouble, addInt, addItem, addString, createBoolArray, createDoubleArray, createIntArray, createStringArray, deleteItemFromObject, detachItemFromObject, getObjectItem, getValueBool, getValueDouble, getValueInt, getValueStr
public java.lang.String serialize()
JSON
public java.lang.String serializeMinify()
JSON
serializeMinify
in class JSON
public static JSON parse(java.lang.String jsonString)
public static JSON parse(byte[] jsonBuffer)
public int getSize()
JSON
public JSON getArrayItem(int index)
JSON
getArrayItem
in class JSON
public JSON detachItemFromArray(int index)
JSON
detachItemFromArray
in class JSON
public void deleteItemFromArray(int index)
JSON
deleteItemFromArray
in class JSON
public static JSONArray createArray(int[] arr)
public static JSONArray createArray(double[] arr)
public static JSONArray createArray(boolean[] arr)