final case class JsArray(seq: Seq[JsValue] = Vector.empty) extends AbstractJsArray with IterableOnce[JsValue] with Json[JsArray] with Product with Serializable
represents an immutable Json array. There are several ways of creating a Json array, being the most common the following:
- From a string, array of bytes or an input stream of bytes, using the parse functions of the companion object
- From the apply function of the companion object:
- seq
immutable seq of JsValue
- Alphabetic
- By Inheritance
- JsArray
- Serializable
- Product
- Equals
- Json
- JsValue
- IterableOnce
- AbstractJsArray
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def appended(value: JsValue): JsArray
- def appendedAll(xs: IterableOnce[JsValue]): JsArray
- Definition Classes
- AbstractJsArray
- final def apply(path: JsPath): JsValue
Returns the element located at a specified path.
Returns the element located at a specified path. This function is total on its argument. If no element is found, JsNothing is returned
- path
the path
- returns
the json value found at the path
- Definition Classes
- Json
- def apply(i: Int): JsValue
- Definition Classes
- AbstractJsArray
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def concat(other: JsArray, ARRAY_AS: JsArray.TYPE.Value = JsArray.TYPE.LIST): JsArray
- def containsPath(path: JsPath): Boolean
Returns true if there is an element at the specified path
Returns true if there is an element at the specified path
- path
the path
- returns
true if the path exists, false otherwise
- Definition Classes
- Json
- def count(p: ((JsPath, JsValue)) => Boolean = (_: (JsPath, JsValue)) => true): Int
Returns the number of elements that satisfy the given predicate
Returns the number of elements that satisfy the given predicate
- p
the predicate to test each path/value pair
- returns
number of elements that satisfy the predicate
- Definition Classes
- Json
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(that: Any): Boolean
- Definition Classes
- JsArray → Equals → AnyRef → Any
- def exists(p: ((JsPath, JsValue)) => Boolean): Boolean
Tests whether a predicate holds for at least one element of this Json
Tests whether a predicate holds for at least one element of this Json
- p
the predicate to test each path/value pair
- returns
true if the given predicate is satisfied by at least one path/value pair, otherwise false
- Definition Classes
- Json
- def filter(p: (JsValue) => Boolean): JsArray
- Definition Classes
- AbstractJsArray
- def filterAll(p: (JsPrimitive) => Boolean): JsArray
- Definition Classes
- AbstractJsArray
- def filterAll(p: (JsPath, JsPrimitive) => Boolean): JsArray
- Definition Classes
- AbstractJsArray
- def filterAllJsObj(p: (JsObj) => Boolean): JsArray
- Definition Classes
- AbstractJsArray
- def filterAllJsObj(p: (JsPath, JsObj) => Boolean): JsArray
- Definition Classes
- AbstractJsArray
- def filterAllKeys(p: (String) => Boolean): JsArray
- Definition Classes
- AbstractJsArray
- def filterAllKeys(p: (JsPath, JsValue) => Boolean): JsArray
- Definition Classes
- AbstractJsArray
- def finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def flatMap(f: (JsValue) => JsArray): JsArray
- Definition Classes
- AbstractJsArray
- def flatten: LazyList[(JsPath, JsValue)]
- returns
a lazy list of pairs of path and value
- Definition Classes
- AbstractJsArray
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def head: JsValue
- Definition Classes
- AbstractJsArray
- def id: Int
Every implementation of this trait has an unique identifier in order.
- def init: JsArray
- Definition Classes
- AbstractJsArray
- def inserted(path: JsPath, value: JsValue, padWith: JsValue = JsNull): JsArray
Creates a new Json obtained by inserting a given path/value pair into this Json.
Creates a new Json obtained by inserting a given path/value pair into this Json. The given element is always inserted at the given path, even if it requires to create new Json or padding arrays.
- path
the path
- value
the value
- returns
A new Json with the new path/value mapping added to this Json.
- def isArr(predicate: (JsArray) => Boolean): Boolean
returns true if this is an array that satisfies a predicate
returns true if this is an array that satisfies a predicate
- Definition Classes
- JsValue
- def isArr: Boolean
- Definition Classes
- AbstractJsArray
- def isBigDec: Boolean
returns true if this is a big decimal.
- def isBigInt: Boolean
returns true if this is a big integer.
- def isBool: Boolean
returns true if this is a boolean
- def isDecimal(predicate: (BigDecimal) => Boolean): Boolean
returns true if this is a big decimal that satisfies a predicate
returns true if this is a big decimal that satisfies a predicate
- Definition Classes
- JsValue
- def isDecimal: Boolean
returns true if this type is a decimal number
- def isDouble: Boolean
returns true if this is a double
- def isDouble(predicate: (Double) => Boolean): Boolean
returns true if this is a double that satisfies a predicate
returns true if this is a double that satisfies a predicate
- Definition Classes
- JsValue
- def isEmpty: Boolean
- Definition Classes
- AbstractJsArray
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isInt: Boolean
returns true if this is an integer (32 bit precision number)
- def isInt(predicate: (Int) => Boolean): Boolean
returns true if this is an integer that satisfies a predicate
returns true if this is an integer that satisfies a predicate
- Definition Classes
- JsValue
- def isIntegral(predicate: (BigInt) => Boolean): Boolean
returns true if this is a big integer that satisfies a predicate
returns true if this is a big integer that satisfies a predicate
- Definition Classes
- JsValue
- def isIntegral: Boolean
returns true if this type is an integral number
returns true if this type is an integral number
- returns
isInt || isLong || isBigInt
- Definition Classes
- JsValue
- def isJson: Boolean
returns true is this type is an array or an object
returns true is this type is an array or an object
- Definition Classes
- JsValue
- def isJson(predicate: (Json[_]) => Boolean): Boolean
returns true if this is a json that satisfies a predicate
returns true if this is a json that satisfies a predicate
- predicate
the predicate
- Definition Classes
- JsValue
- def isLong: Boolean
returns true if this is a long (62 bit precision number)
- def isLong(predicate: (Long) => Boolean): Boolean
returns true if this is a long that satisfies a predicate
returns true if this is a long that satisfies a predicate
- Definition Classes
- JsValue
- def isNotEmpty: Boolean
- Definition Classes
- Json
- def isNotJson: Boolean
returns true if this is neither an object nor an array
returns true if this is neither an object nor an array
- Definition Classes
- JsValue
- def isNotNull: Boolean
returns true if this is not null
returns true if this is not null
- Definition Classes
- JsValue
- def isNotNumber: Boolean
returns true if this is not a number
returns true if this is not a number
- Definition Classes
- JsValue
- def isNothing: Boolean
returns true if this is JsNothing
- def isNull: Boolean
returns true if this is JsNull
- def isNumber: Boolean
returns true if this is a number
- def isObj(predicate: (JsObj) => Boolean): Boolean
returns true if this is an object that satisfies a predicate
returns true if this is an object that satisfies a predicate
- Definition Classes
- JsValue
- def isObj: Boolean
- Definition Classes
- AbstractJsArray
- def isPrimitive: Boolean
returns true is this is a primitive type
- def isStr: Boolean
returns true if this is a string
- def isStr(predicate: (String) => Boolean): Boolean
returns true if this is a string that satisfies a predicate
returns true if this is a string that satisfies a predicate
- Definition Classes
- JsValue
- def iterator: Iterator[JsValue]
- Definition Classes
- AbstractJsArray
- def knownSize: Int
- Definition Classes
- IterableOnce
- def last: JsValue
- Definition Classes
- AbstractJsArray
- def length(): Int
- Definition Classes
- AbstractJsArray
- def map(m: (JsValue) => JsValue): JsArray
- Definition Classes
- AbstractJsArray
- def mapAll(m: (JsPrimitive) => JsValue): JsArray
- Definition Classes
- AbstractJsArray
- def mapAll(m: (JsPath, JsPrimitive) => JsValue, p: (JsPath, JsPrimitive) => Boolean = (_, _) => true): JsArray
- Definition Classes
- AbstractJsArray
- def mapAllKeys(m: (String) => String): JsArray
- Definition Classes
- AbstractJsArray
- def mapAllKeys(m: (JsPath, JsValue) => String, p: (JsPath, JsValue) => Boolean = (_, _) => true): JsArray
- Definition Classes
- AbstractJsArray
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def nonEmpty: Boolean
returns true if the Json is non empty
returns true if the Json is non empty
- returns
true if non empty, false otherwise
- Definition Classes
- Json
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def prepended(value: JsValue): JsArray
- def prependedAll(xs: IterableOnce[JsValue]): JsArray
- Definition Classes
- AbstractJsArray
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def reduceAll[V](p: (JsPath, JsPrimitive) => Boolean = (_, _) => true, m: (JsPath, JsPrimitive) => V, r: (V, V) => V): Option[V]
- Definition Classes
- AbstractJsArray
- def removed(path: JsPath): JsArray
Removes a path from this Json
- def removedAll(xs: IterableOnce[JsPath]): JsArray
Creates a new Json from this Json by removing all paths of another collection
- def serialize: Array[Byte]
Serialize this Json into an array of bytes.
Serialize this Json into an array of bytes. When possible, it's more efficient to work on byte level that with strings
- returns
this Json serialized into an array of bytes
- Definition Classes
- Json
- def serialize(outputStream: OutputStream): () => Unit
Returns a zero-argument function that when called, it serializes this Json into the given output stream, no returning anything
Returns a zero-argument function that when called, it serializes this Json into the given output stream, no returning anything
- outputStream
the output stream
- returns
() => Unit function that serializes this Json into the given output stream
- Definition Classes
- Json
- def size: Int
- Definition Classes
- AbstractJsArray
- def stepper[S <: Stepper[_]](implicit shape: StepperShape[JsValue, S]): S
- Definition Classes
- IterableOnce
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def tail: JsArray
- Definition Classes
- AbstractJsArray
- def toJsArray: JsArray
returns this value as a JsArray if it's an array, throwing an UserError otherwise.
- def toJsBigDec: JsBigDec
returns this value as a JsBigDec if it's a decimal number, throwing an UserError otherwise.
- def toJsBigInt: JsBigInt
returns this value as a JsBigInt if it's an integral number, throwing an UserError otherwise.
- def toJsBool: JsBool
returns this value as a JsBool if it's a boolean, throwing an UserError otherwise.
- def toJsDouble: JsDouble
returns this value as a JsDouble if it is a JsLong or a JsInt or a JsDouble, throwing an UserError otherwise.
- def toJsInt: JsInt
returns this value as a JsInt, throwing an UserError otherwise.
- def toJsLong: JsLong
returns this value as a JsLong if it is a JsLong or a JsInt, throwing an UserError otherwise.
- def toJsNull: JsNull.type
returns this value as a JsNull if it's null, throwing an UserError otherwise.
- def toJsNumber: JsNumber
returns this value as a JsNumber if it's a number, throwing an UserError otherwise.
- def toJsObj: JsObj
- Definition Classes
- AbstractJsArray
- def toJsPrimitive: JsPrimitive
- def toJsStr: JsStr
returns this value as a JsStr if it's a string, throwing an UserError otherwise.
- def toJson: Json[_]
returns this value as a Json if it's an object or an array, throwing an UserError otherwise.
- def toPrettyString: String
Converts the string representation of this Json to a pretty print version
Converts the string representation of this Json to a pretty print version
- returns
pretty print version of the string representation of this Json
- Definition Classes
- Json
- def toString(): String
string representation of this Json array.
- def validate(spec: ArrayOfObjSpec): LazyList[(JsPath, Invalid)]
- def validate(spec: JsArraySpec): LazyList[(JsPath, Invalid)]
- def validate(predicate: JsArrayPredicate): Result
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()