to

infix fun String.to(value: String)(source)

Sets the JsonElement at this pointer path to value.

Return

Unit

Receiver

The JSON Pointer path string identifying the location to set.

Parameters

value

The String value to set; wrapped in JsonPrimitive.

Throws

if the path is invalid or navigation fails.

if an array index in the pointer path is out of bounds.


infix fun String.to(value: Boolean)(source)

Sets the JsonElement at this pointer path to value.

Return

Unit

Receiver

The JSON Pointer path string identifying the location to set.

Parameters

value

The Boolean value to set; wrapped in JsonPrimitive.

Throws

if the path is invalid or navigation fails.

if an array index in the pointer path is out of bounds.


infix fun String.to(value: Int)(source)

Sets the JsonElement at this pointer path to value.

Return

Unit

Receiver

The JSON Pointer path string identifying the location to set.

Parameters

value

The Int value to set; wrapped in JsonPrimitive.

Throws

if the path is invalid or navigation fails.

if an array index in the pointer path is out of bounds.


infix fun String.to(value: Long)(source)

Sets the JsonElement at this pointer path to value.

Return

Unit

Receiver

The JSON Pointer path string identifying the location to set.

Parameters

value

The Long value to set; wrapped in JsonPrimitive.

Throws

if the path is invalid or navigation fails.

if an array index in the pointer path is out of bounds.


infix fun String.to(value: Float)(source)

Sets the JsonElement at this pointer path to value.

Note: Float values may not round-trip exactly due to how JsonPrimitive serializes floating-point numbers.

Return

Unit

Receiver

The JSON Pointer path string identifying the location to set.

Parameters

value

The Float value to set; wrapped in JsonPrimitive.

Throws

if the path is invalid or navigation fails.

if an array index in the pointer path is out of bounds.


infix fun String.to(value: Double)(source)

Sets the JsonElement at this pointer path to value.

Return

Unit

Receiver

The JSON Pointer path string identifying the location to set.

Parameters

value

The Double value to set; wrapped in JsonPrimitive.

Throws

if the path is invalid or navigation fails.

if an array index in the pointer path is out of bounds.


infix fun String.to(value: Nothing?)(source)

Sets the JsonElement at this pointer path to JsonNull.

This overload is the most-specific match for a literal null at the call site and takes precedence over the JsonElement overload.

Return

Unit

Receiver

The JSON Pointer path string identifying the location to set.

Parameters

value

Must be null.

Throws

if the path is invalid or navigation fails.

if an array index in the pointer path is out of bounds.


infix fun String.to(value: JsonElement)(source)

Sets the JsonElement at this pointer path to value.

Use this overload when holding a JsonElement variable (including JsonObject, JsonArray, JsonPrimitive, or JsonNull). For literal primitive values, prefer the typed overloads. For literal null, prefer to(value: Nothing?).

Return

Unit

Receiver

The JSON Pointer path string identifying the location to set.

Parameters

value

The JsonElement to set at the specified path.

Throws

if the path is invalid or navigation fails.

if an array index in the pointer path is out of bounds.


infix fun JsonPointer.to(value: String)(source)

Sets the JsonElement at this pointer to value.

Return

Unit

Receiver

The JsonPointer identifying the location to set.

Parameters

value

The String value to set; wrapped in JsonPrimitive.

Throws

if the pointer is the root or navigation fails.

if an array index in the pointer path is out of bounds.


infix fun JsonPointer.to(value: Boolean)(source)

Sets the JsonElement at this pointer to value.

Return

Unit

Receiver

The JsonPointer identifying the location to set.

Parameters

value

The Boolean value to set; wrapped in JsonPrimitive.

Throws

if the pointer is the root or navigation fails.

if an array index in the pointer path is out of bounds.


infix fun JsonPointer.to(value: Int)(source)

Sets the JsonElement at this pointer to value.

Return

Unit

Receiver

The JsonPointer identifying the location to set.

Parameters

value

The Int value to set; wrapped in JsonPrimitive.

Throws

if the pointer is the root or navigation fails.

if an array index in the pointer path is out of bounds.


infix fun JsonPointer.to(value: Long)(source)

Sets the JsonElement at this pointer to value.

Return

Unit

Receiver

The JsonPointer identifying the location to set.

Parameters

value

The Long value to set; wrapped in JsonPrimitive.

Throws

if the pointer is the root or navigation fails.

if an array index in the pointer path is out of bounds.


infix fun JsonPointer.to(value: Float)(source)

Sets the JsonElement at this pointer to value.

Note: Float values may not round-trip exactly due to how JsonPrimitive serializes floating-point numbers.

Return

Unit

Receiver

The JsonPointer identifying the location to set.

Parameters

value

The Float value to set; wrapped in JsonPrimitive.

Throws

if the pointer is the root or navigation fails.

if an array index in the pointer path is out of bounds.


infix fun JsonPointer.to(value: Double)(source)

Sets the JsonElement at this pointer to value.

Return

Unit

Receiver

The JsonPointer identifying the location to set.

Parameters

value

The Double value to set; wrapped in JsonPrimitive.

Throws

if the pointer is the root or navigation fails.

if an array index in the pointer path is out of bounds.


infix fun JsonPointer.to(value: Nothing?)(source)

Sets the JsonElement at this pointer to JsonNull.

This overload is the most-specific match for a literal null at the call site and takes precedence over the JsonElement overload.

Return

Unit

Receiver

The JsonPointer identifying the location to set.

Parameters

value

Must be null.

Throws

if the pointer is the root or navigation fails.

if an array index in the pointer path is out of bounds.


infix fun JsonPointer.to(value: JsonElement)(source)

Sets the JsonElement at this pointer to value.

Use this overload when holding a JsonElement variable (including JsonObject, JsonArray, JsonPrimitive, or JsonNull). For literal primitive values, prefer the typed overloads. For literal null, prefer to(value: Nothing?).

Return

Unit

Receiver

The JsonPointer identifying the location to set.

Parameters

value

The JsonElement to set at the specified path.

Throws

if the pointer is the root or navigation fails.

if an array index in the pointer path is out of bounds.