trait JsValue extends AnyRef
Every element in a Json is a JsValue.
- Alphabetic
- By Inheritance
- JsValue
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
- abstract def asJsArray: JsArray
returns this value as a JsArray if it's an array, throwing an UserError otherwise.
returns this value as a JsArray if it's an array, throwing an UserError otherwise. It's the responsibility of the caller to make sure the call to this function doesn't fail. The guard condition
isArr
can help to that purpose.
isArr }}}
- returns
this value as a JsArray
- Exceptions thrown
UserError
if it's not an array
- abstract def asJsBigDec: JsBigDec
returns this value as a JsBigDec if it's a decimal number, throwing an UserError otherwise.
returns this value as a JsBigDec if it's a decimal number, throwing an UserError otherwise. It's the responsibility of the caller to make sure the call to this function doesn't fail. The guard condition
isDecimal
can help to that purpose.
isDecimal }}}
- returns
this value as a JsBigDec
- Exceptions thrown
UserError
if the conversion can't be done
- abstract def asJsBigInt: JsBigInt
returns this value as a JsBigInt if it's an integral number, throwing an UserError otherwise.
returns this value as a JsBigInt if it's an integral number, throwing an UserError otherwise. It's the responsibility of the caller to make sure the call to this function doesn't fail. The guard condition
isIntegral
can help to that purpose.
isIntegral }}}
- returns
this value as a JsBigInt
- Exceptions thrown
UserError
if the conversion can't be done
- abstract def asJsBool: JsBool
returns this value as a JsBool if it's a boolean, throwing an UserError otherwise.
returns this value as a JsBool if it's a boolean, throwing an UserError otherwise. It's the responsibility of the caller to make sure the call to this function doesn't fail. The guard condition
isBool
can help to that purpose.
isBool }}}
- returns
this value as a JsBool
- Exceptions thrown
UserError
if it's not a boolean
- abstract def asJsDouble: JsDouble
returns this value as a JsDouble if it is a JsLong or a JsInt or a JsDouble , throwing an UserError otherwise.
returns this value as a JsDouble if it is a JsLong or a JsInt or a JsDouble , throwing an UserError otherwise. It's the responsibility of the caller to make sure the call to this function doesn't fail. The guard condition
isInt || isLong || isDouble
can help to that purpose.
isInt || isLong || isDouble }}}
- returns
this value as a JsDouble
- Exceptions thrown
UserError
if the conversion can't be done
- abstract def asJsInt: JsInt
returns this value as a JsInt , throwing an UserError otherwise.
returns this value as a JsInt , throwing an UserError otherwise. It's the responsibility of the caller to make sure the call to this function doesn't fail. The guard condition
isInt
can help to that purpose.
isInt }}}
- returns
this value as a JsInt
- Exceptions thrown
UserError
if the conversion can't be done
- abstract def asJsLong: JsLong
returns this value as a
JsLong if it is a JsLong or a JsInt , throwing an UserError otherwise. It's the responsibility of the caller to make sure the call to this function doesn't fail. The guard condition
returns this value as a
JsLong if it is a JsLong or a JsInt , throwing an UserError otherwise. It's the responsibility of the caller to make sure the call to this function doesn't fail. The guard condition
isInt || isLong
can help to that purpose.
isInt || isLong }}}
- returns
this value as a JsLong
- Exceptions thrown
UserError
if the conversion can't be done
- abstract def asJsNull: JsNull.type
returns this value as a JsNull if it's null, throwing an UserError otherwise.
returns this value as a JsNull if it's null, throwing an UserError otherwise. It's the responsibility of the caller to make sure the call to this function doesn't fail. The guard condition
isNull
can help to that purpose.
isNull }}}
- returns
this value as a JsNull
- Exceptions thrown
UserError
if it's not a boolean
- abstract def asJsNumber: JsNumber
returns this value as a JsNumber if it's a number, throwing an UserError otherwise.
returns this value as a JsNumber if it's a number, throwing an UserError otherwise. It's the responsibility of the caller to make sure the call to this function doesn't fail. The guard condition
isNumber
can help to that purpose.
isNumber }}}
- returns
this value as a JsNumber
- Exceptions thrown
UserError
if it's not a number
- abstract def asJsObj: JsObj
returns this value as a JsObj if it's an object, throwing an UserError otherwise.
returns this value as a JsObj if it's an object, throwing an UserError otherwise. It's the responsibility of the caller to make sure the call to this function doesn't fail. The guard condition
isObj
can help to that purpose.
isObj }}}
- returns
this value as a JsObj
- Exceptions thrown
UserError
if it's not an object
- abstract def asJsStr: JsStr
returns this value as a JsStr if it's a string, throwing an UserError otherwise.
returns this value as a JsStr if it's a string, throwing an UserError otherwise. It's the responsibility of the caller to make sure the call to this function doesn't fail. The guard condition
isStr
can help to that purpose.
isStr }}}
- returns
this value as a JsStr
- Exceptions thrown
UserError
if it's not a string
- abstract def asJson: Json[_]
returns this value as a Json if it's an object or an array, throwing an UserError otherwise.
returns this value as a Json if it's an object or an array, throwing an UserError otherwise. It's the responsibility of the caller to make sure the call to this function doesn't fail. The guard condition
isJson
can help to that purpose.
isJson }}}
- returns
this value as a Json
- Exceptions thrown
UserError
if it's not an array or an object
- abstract def id: Int
Every implementation of this trait has an unique identifier.
Every implementation of this trait has an unique identifier.
- returns
unique identifier of the type
- abstract def isArr: Boolean
returns true if this is an array
- abstract def isBigDec: Boolean
returns true if this is a big decimal.
returns true if this is a big decimal.
- returns
true if this is a big decimal and false otherwise. If this is a double, it returns false.
- abstract def isBigInt: Boolean
returns true if this is a big integer.
returns true if this is a big integer.
- returns
true if this is a big integer and false otherwise. If this is either an integer or a long, it returns false.
- abstract def isBool: Boolean
returns true if this is a boolean
- abstract def isDouble: Boolean
returns true if this is a double
- abstract def isInt: Boolean
returns true if this is a integer (32 bit precision number)
- abstract def isLong: Boolean
returns true if this is a long (62 bit precision number)
returns true if this is a long (62 bit precision number)
- returns
true if this is a long and false otherwise. If this is an integer, it returns false.
- abstract def isNothing: Boolean
returns true if this is JsNothing
- abstract def isNull: Boolean
returns true if this is JsNull
- abstract def isNumber: Boolean
returns true if this is a number
- abstract def isObj: Boolean
returns true if this is an object
- abstract def isStr: Boolean
returns true if this is a string
Concrete 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
- 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()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- 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
- predicate
the predicate
- def isBigDec(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
- predicate
the predicate
- returns
true if this is a big decimal that satisfies the predicate. If this is a double, it returns false
- def isBigInt(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
- predicate
the predicate
- returns
true if this is a big integer that satisfies the predicate. If this is either an integer or a long, it returns false.
- def isDecimal: Boolean
returns true if this type is a decimal number
returns true if this type is a decimal number
- returns
isDouble || isBigDec
- 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
- predicate
the predicate
- returns
true if this is a double that satisfies the predicate
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- 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
- predicate
the predicate
- 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
- def isJson(predicate: (Json[_]) => Boolean): Boolean
returns true if this is a json that satisfy a predicate
returns true if this is a json that satisfy a predicate
- predicate
the predicate
- def isJson: Boolean
returns true is this type is an array or an object
- 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
- predicate
the predicate
- returns
true if this is a long that satisfies the predicate and false otherwise. If this is an integer, it returns false.
- def isNotJson: Boolean
returns true if this is neither an object nor an array
- def isNotNumber: Boolean
returns true if this is not 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
- predicate
the predicate
- 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
- predicate
the predicate
- def mapIfNotNothing[T](default: () => T, map: (JsValue) => T): T
if this is JsNothing, it returns a value computed by the default supplier.
if this is JsNothing, it returns a value computed by the default supplier. Otherwise, it returns the result of applying the map function to this.
- T
the type of the returned value
- default
the supplier to compute the default value
- map
the map function
- returns
a value of type T
- def mapIfNotNull[T](default: () => T, map: (JsValue) => T): T
if this is JsNull, it returns a value computed by the default supplier.
if this is JsNull, it returns a value computed by the default supplier. Otherwise, it returns the result of applying the map function to this.
- T
the type of the returned value
- default
the supplier to compute the default value
- map
the map function
- returns
a value of type T
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- 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()