JsonArrayBuilder

class JsonArrayBuilder

DSL builder for a JsonArray. To create an instance of builder, use buildJsonArray build function.

Functions

add
Link copied to clipboard
fun add(element: JsonElement): Boolean

Adds the given JSON element to a resulting array.

Extensions

add
Link copied to clipboard
fun JsonArrayBuilder.add(value: Boolean?): Boolean

Adds the given boolean value to a resulting array.

fun JsonArrayBuilder.add(value: Number?): Boolean

Adds the given numeric value to a resulting array.

fun JsonArrayBuilder.add(value: String?): Boolean

Adds the given string value to a resulting array.

addJsonArray
Link copied to clipboard
fun JsonArrayBuilder.addJsonArray(builderAction: JsonArrayBuilder.() -> Unit): Boolean

Adds the JSON produced by the builderAction function to a resulting array.

addJsonObject
Link copied to clipboard
fun JsonArrayBuilder.addJsonObject(builderAction: JsonObjectBuilder.() -> Unit): Boolean

Adds the JSON produced by the builderAction function to a resulting array.