Class JsonArray
java.lang.Object
io.github.grumpystuff.grumpyjson.json_model.JsonElement
io.github.grumpystuff.grumpyjson.json_model.JsonArray
This class represents JSON arrays.
-
Method Summary
Modifier and TypeMethodDescriptionfinal List<JsonElement>If this JSON element is not a JSON array, this method throws aJsonDeserializationException, otherwise it returns the array's elements as aList.booleanabstract List<JsonElement>Returns the elements of this JSON array as aList.inthashCode()static JsonArrayof(JsonElement... elements) Creates an instance of this class from elements passed as varargs.static JsonArrayof(List<JsonElement> elements) Creates an instance of this class from aListcontaining the elements of the JSON array.toString()Methods inherited from class io.github.grumpystuff.grumpyjson.json_model.JsonElement
deserializerExpectsBoolean, deserializerExpectsNull, deserializerExpectsNumber, deserializerExpectsObject, deserializerExpectsString
-
Method Details
-
of
Creates an instance of this class from aListcontaining the elements of the JSON array.- Parameters:
elements- the elements of the JSON array to create- Returns:
- the JSON array
-
of
Creates an instance of this class from elements passed as varargs.- Parameters:
elements- the elements of the JSON array to create- Returns:
- the JSON array
-
getAsList
Returns the elements of this JSON array as aList.- Returns:
- the elements
-
deserializerExpectsArray
Description copied from class:JsonElementIf this JSON element is not a JSON array, this method throws aJsonDeserializationException, otherwise it returns the array's elements as aList.- Overrides:
deserializerExpectsArrayin classJsonElement- Returns:
- the list of elements
-
equals
-
hashCode
public int hashCode() -
toString
-