JsonArrayMutationScope

DSL scope for applying pointer-based mutations to a JsonArray.

Instances are created internally by JsonArray.mutate and exposed only via its lambda parameter. Use the to infix functions to specify mutations.

Functions

Link copied to clipboard
fun remove(pointer: JsonPointer)

Removes the element identified by pointer from this array.

fun remove(path: String)

Removes the element identified by path from this array.

Link copied to clipboard
infix fun JsonPointer.to(value: Boolean)
infix fun JsonPointer.to(value: Double)
infix fun JsonPointer.to(value: Float)
infix fun JsonPointer.to(value: Int)
infix fun JsonPointer.to(value: Long)
infix fun JsonPointer.to(value: String)
infix fun JsonPointer.to(value: JsonElement)

Sets the JsonElement at this pointer to value.

infix fun JsonPointer.to(value: Nothing?)

Sets the JsonElement at this pointer to JsonNull.

infix fun String.to(value: Boolean)
infix fun String.to(value: Double)
infix fun String.to(value: Float)
infix fun String.to(value: Int)
infix fun String.to(value: Long)
infix fun String.to(value: String)
infix fun String.to(value: JsonElement)

Sets the JsonElement at this pointer path to value.

infix fun String.to(value: Nothing?)

Sets the JsonElement at this pointer path to JsonNull.