Class JsonArray
java.lang.Object
name.martingeisse.grumpyjson.json_model.JsonElement
name.martingeisse.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(List<JsonElement> elements) Creates an instance of this class from aListcontaining the elements of the JSON array.static JsonArrayof(JsonElement... elements) Creates an instance of this class from elements passed as varargs.toString()Methods inherited from class name.martingeisse.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
-