api / tv.twelvetone.json / JsonArray / set

set

operator fun set(index: Int, value: Int): JsonArray

Replaces the element at the specified position in this array with the JSON representation of the specified int value.

Parameters

index - the index of the array element to replace value - the value to be stored at the specified array position

Exceptions

IndexOutOfBoundsException - if the index is out of range, i.e. index < 0 or index >= size

Return
the array itself, to enable method chaining

operator fun set(index: Int, value: Long): JsonArray

Replaces the element at the specified position in this array with the JSON representation of the specified long value.

Parameters

index - the index of the array element to replace value - the value to be stored at the specified array position

Exceptions

IndexOutOfBoundsException - if the index is out of range, i.e. index < 0 or index >= size

Return
the array itself, to enable method chaining

operator fun set(index: Int, value: Float): JsonArray

Replaces the element at the specified position in this array with the JSON representation of the specified float value.

Parameters

index - the index of the array element to replace value - the value to be stored at the specified array position

Exceptions

IndexOutOfBoundsException - if the index is out of range, i.e. index < 0 or index >= size

Return
the array itself, to enable method chaining

operator fun set(index: Int, value: Double): JsonArray

Replaces the element at the specified position in this array with the JSON representation of the specified double value.

Parameters

index - the index of the array element to replace value - the value to be stored at the specified array position

Exceptions

IndexOutOfBoundsException - if the index is out of range, i.e. index < 0 or index >= size

Return
the array itself, to enable method chaining

operator fun set(index: Int, value: Boolean): JsonArray

Replaces the element at the specified position in this array with the JSON representation of the specified boolean value.

Parameters

index - the index of the array element to replace value - the value to be stored at the specified array position

Exceptions

IndexOutOfBoundsException - if the index is out of range, i.e. index < 0 or index >= size

Return
the array itself, to enable method chaining

operator fun set(index: Int, value: String): JsonArray

Replaces the element at the specified position in this array with the JSON representation of the specified string.

Parameters

index - the index of the array element to replace value - the string to be stored at the specified array position

Exceptions

IndexOutOfBoundsException - if the index is out of range, i.e. index < 0 or index >= size

Return
the array itself, to enable method chaining

operator fun set(index: Int, value: JsonValue?): JsonArray

Replaces the element at the specified position in this array with the specified JSON value.

Parameters

index - the index of the array element to replace value - the value to be stored at the specified array position, must not be null

Exceptions

IndexOutOfBoundsException - if the index is out of range, i.e. index < 0 or index >= size

Return
the array itself, to enable method chaining