class JsonValue
source · line 10public class JsonValue internal constructor(internal val node: JsonNode)
An immutable JSON value tree. Accessors check the JSON kind without coercion, collection snapshots preserve order, and the codec preserves exact JSON number tokens.
function asBoolean
source · line 31public fun asBoolean(): Boolean
Reads a Boolean, rejecting every other JSON kind.
function get
source · line 74public operator fun get(index: Long): JsonValue
Reads an array element in constant time; invalid indices throw IndexOutOfBoundsException.
parameter index
source · line 74index: Long
function keys
source · line 77public fun keys(): Array<String>
Returns an independent array of object keys in stored order, in linear time.
function asIntegralLong
source · line 37public fun asIntegralLong(): Long
Reads an exactly integral Long, allowing decimal and exponent spellings without rounding.
function get
source · line 64public operator fun get(name: String): JsonValue?
Looks up a field by name. A present JSON null is returned as Some(JsonValue).
parameter name
source · line 64name: String
property kind
source · line 12public val kind: JsonValueKind
get: public read-only
The JSON kind of this value.
getter get
source · line 12get(): JsonValueKind
function asFloat
source · line 41public fun asFloat(): Float
Rounds a JSON number directly to Float, rejecting overflow.
function elements
source · line 95public fun elements(): Array<JsonValue>
Returns an independent element array in index order, sharing immutable child nodes.
function asLong
source · line 35public fun asLong(): Long
Reads an exact Long; fractions, exponents, and out-of-range integers fail.
function asDouble
source · line 43public fun asDouble(): Double
Rounds a JSON number directly to Double, rejecting overflow.
property size
source · line 23public val size: Long
get: public read-only
Object member or array element count; other kinds throw DecodingException.
getter get
source · line 23get(): Long
function members
source · line 86public fun members(): Array<(String, JsonValue)>
Returns an independent member array in stored order, sharing immutable child nodes.
function asString
source · line 33public fun asString(): String
Reads a String, rejecting every other JSON kind.
function asNumberToken
source · line 45public fun asNumberToken(): String
Returns the original number token without imposing a machine-number range.
function asULong
source · line 39public fun asULong(): ULong
Reads an exact ULong; signs, fractions, exponents, and overflow are checked.
function containsKey
source · line 71public fun containsKey(name: String): Boolean
Tests object membership by name. Other kinds throw DecodingException.
parameter name
source · line 71name: String