JsonArray

trait JsonArray extends JsonStructure

Defines JSON array.

See also
Companion
object
trait JsonValue
class Object
trait Matchable
class Any

Value members

Abstract methods

@targetName("concat")
def ++(suffix: JsonArray): JsonArray

Concatenates JSON array.

Concatenates JSON array.

Returns

new JSON array

@targetName("prepend")
def +:(value: JsonValue): JsonArray

Prepends value.

Prepends value.

Returns

new JSON array

@targetName("append")
def :+(value: JsonValue): JsonArray

Appends value.

Appends value.

Returns

new JSON array

def apply(index: Int): JsonValue

Gets value at given index.

Gets value at given index.

Selects first value in array.

Selects first value in array.

Throws
NoSuchElementException

if array is empty

def headOption: Option[JsonValue]

Optionally selects first value in array.

Optionally selects first value in array.

Selects all values in array excluding last.

Selects all values in array excluding last.

Throws
UnsupportedOperationException

if array is empty

Selects last value in array.

Selects last value in array.

Throws
NoSuchElementException

if array is empty

def lastOption: Option[JsonValue]

Optionally selects last value in array.

Optionally selects last value in array.

def slice(from: Int, until: Int): JsonArray

Selects slice of array.

Selects slice of array.

Value Params
from

lowest index to include

until

lowest index to exclude

Returns

slice of JSON array containing elements whose indexes are greater than or equal to from and less than until

Selects all values in array excluding first.

Selects all values in array excluding first.

Throws
UnsupportedOperationException

if array is empty

def updated(index: Int, value: JsonValue): JsonArray

Updates value at given index.

Updates value at given index.

Returns

new JSON array

def values: Seq[JsonValue]

Gets values.

Gets values.

Concrete methods

def getBigDecimal(index: Int): BigDecimal

Gets BigDecimal at given index.

Gets BigDecimal at given index.

Throws
ClassCastException

if not JsonNumber

def getBigInt(index: Int): BigInt

Gets BigInt at given index.

Gets BigInt at given index.

Throws
ClassCastException

if not JsonNumber

def getBoolean(index: Int): Boolean

Gets Boolean at given index.

Gets Boolean at given index.

Throws
ClassCastException

if not JsonBoolean

def getByte(index: Int): Byte

Gets Byte at given index.

Gets Byte at given index.

Throws
ClassCastException

if not JsonNumber

def getDouble(index: Int): Double

Gets Double at given index.

Gets Double at given index.

Throws
ClassCastException

if not JsonNumber

def getFloat(index: Int): Float

Gets Float at given index.

Gets Float at given index.

Throws
ClassCastException

if not JsonNumber

def getInt(index: Int): Int

Gets Int at given index.

Gets Int at given index.

Throws
ClassCastException

if not JsonNumber

def getJsonArray(index: Int): JsonArray

Gets JSON array at given index.

Gets JSON array at given index.

Throws
ClassCastException

if not JsonArray

def getJsonBoolean(index: Int): JsonBoolean

Gets JSON boolean at given index.

Gets JSON boolean at given index.

Throws
ClassCastException

if not JsonBoolean

def getJsonNull(index: Int): JsonNull

Gets JSON null at given index.

Gets JSON null at given index.

Throws
ClassCastException

if not JsonNull

def getJsonNumber(index: Int): JsonNumber

Gets JSON number at given index.

Gets JSON number at given index.

Throws
ClassCastException

if not JsonNumber

def getJsonObject(index: Int): JsonObject

Gets JSON object at given index.

Gets JSON object at given index.

Throws
ClassCastException

if not JsonObject

def getJsonString(index: Int): JsonString

Gets JSON string at given index.

Gets JSON string at given index.

Throws
ClassCastException

if not JsonString

def getLong(index: Int): Long

Gets Long at given index.

Gets Long at given index.

Throws
ClassCastException

if not JsonNumber

def getShort(index: Int): Short

Gets Short at given index.

Gets Short at given index.

Throws
ClassCastException

if not JsonNumber

def getString(index: Int): String

Gets String at given index.

Gets String at given index.

Throws
ClassCastException

if not JsonString

def isNull(index: Int): Boolean

Tests for null at given index.

Tests for null at given index.

Inherited methods

final
def as[T](using converter: JsonInput[T]): T

Converts value.

Converts value.

Inherited from
JsonValue
def isEmpty: Boolean

Tests for emptiness.

Tests for emptiness.

Inherited from
JsonStructure
def size: Int

Gets size.

Gets size.

Inherited from
JsonStructure