Scoop API

scoop:scoop.json:0.1.0

JsonValue

class JsonValue

source · line 10
public
public 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 31
public
public fun asBoolean(): Boolean

Reads a Boolean, rejecting every other JSON kind.

function keys

source · line 77
public
public fun keys(): Array<String>

Returns an independent array of object keys in stored order, in linear time.

function asIntegralLong

source · line 37
public
public fun asIntegralLong(): Long

Reads an exactly integral Long, allowing decimal and exponent spellings without rounding.

function asFloat

source · line 41
public
public fun asFloat(): Float

Rounds a JSON number directly to Float, rejecting overflow.

function elements

source · line 95
public
public fun elements(): Array<JsonValue>

Returns an independent element array in index order, sharing immutable child nodes.

function asLong

source · line 35
public
public fun asLong(): Long

Reads an exact Long; fractions, exponents, and out-of-range integers fail.

function asDouble

source · line 43
public
public fun asDouble(): Double

Rounds a JSON number directly to Double, rejecting overflow.

function asString

source · line 33
public
public fun asString(): String

Reads a String, rejecting every other JSON kind.

function asNumberToken

source · line 45
public
public fun asNumberToken(): String

Returns the original number token without imposing a machine-number range.

function asULong

source · line 39
public
public fun asULong(): ULong

Reads an exact ULong; signs, fractions, exponents, and overflow are checked.