put

fun JsonObjectBuilder.put(key: String, value: Boolean?): JsonElement?

Add the given boolean value to a resulting JSON object using the given key.

Returns the previous value associated with key, or null if the key was not present.


fun JsonObjectBuilder.put(key: String, value: Number?): JsonElement?

Add the given numeric value to a resulting JSON object using the given key.

Returns the previous value associated with key, or null if the key was not present.


fun JsonObjectBuilder.put(key: String, value: String?): JsonElement?

Add the given string value to a resulting JSON object using the given key.

Returns the previous value associated with key, or null if the key was not present.


fun JsonObjectBuilder.put(key: String, value: Nothing?): JsonElement?

Add null to a resulting JSON object using the given key.

Returns the previous value associated with key, or null if the key was not present.