JsonArrayBuilder

class JsonArrayBuilder

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

Functions

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

Adds the given JSON element to a resulting JSON array.

Extensions

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

Adds the given boolean value to a resulting JSON array.

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

Adds the given numeric value to a resulting JSON array.

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

Adds the given string value to a resulting JSON array.

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

Adds null to a resulting JSON array.

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

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

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

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