Companion

Functions

Link copied to clipboard
fun from(value: Any?): JsonElement

Create a JsonElement from any anonymous value (Will throw an exception if it can't process the value)

@JvmName(name = "fromElements")
fun from(vararg values: JsonElement): JsonArray

Create a JsonArray from JsonElements

fun from(vararg values: Any?): JsonArray

Create a JsonArray from anonymous values

@JvmName(name = "fromElements")
fun from(vararg values: Pair<String, JsonElement>): JsonObject

Create a JsonObject from JsonElements

fun from(vararg values: Pair<String, Any?>): JsonObject

Create a JsonObject from anonymous values

Create a JsonBooleanElement from a Boolean

Create a JsonIntegerElement from a Byte

Create a JsonDoubleElement from a Double

Create a JsonDoubleElement from a Float

Create a JsonIntegerElement from a Int

Create a JsonIntegerElement from a Long

Create a JsonIntegerElement from a Short

Create a JsonStringElement from a String

@JvmName(name = "fromElements")
fun from(value: Collection<JsonElement>): JsonArray

Create a JsonArray from a Collection of JsonElements

fun from(value: Collection<Any?>): JsonArray

Create a JsonArray from a Collection of anonymous values

@JvmName(name = "fromElements")
fun from(value: Map<String, JsonElement>): JsonObject

Create a JsonObject from a Map of JsonElements

fun from(value: Map<String, Any?>): JsonObject

Create a JsonObject from a Map of anonymous values