Packages

t

value

JsPrimitive

sealed trait JsPrimitive extends JsValue

Represents any value in a Json that is not a container, i.e. a Json object or a Json array

Linear Supertypes
JsValue, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. JsPrimitive
  2. JsValue
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def id: Int

    Every implementation of this trait has an unique identifier in order.

    Every implementation of this trait has an unique identifier in order.

    returns

    unique identifier of the type

    Definition Classes
    JsValue
  2. abstract def isBigDec: Boolean

    returns true if this is a big decimal.

    returns true if this is a big decimal.

    Definition Classes
    JsValue
  3. abstract def isBigInt: Boolean

    returns true if this is a big integer.

    returns true if this is a big integer.

    Definition Classes
    JsValue
  4. abstract def isBool: Boolean

    returns true if this is a boolean

    returns true if this is a boolean

    Definition Classes
    JsValue
  5. abstract def isDouble: Boolean

    returns true if this is a double

    returns true if this is a double

    Definition Classes
    JsValue
  6. abstract def isInt: Boolean

    returns true if this is an integer (32 bit precision number)

    returns true if this is an integer (32 bit precision number)

    Definition Classes
    JsValue
  7. 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)

    Definition Classes
    JsValue
  8. abstract def isNull: Boolean

    returns true if this is JsNull

    returns true if this is JsNull

    Definition Classes
    JsValue
  9. abstract def isNumber: Boolean

    returns true if this is a number

    returns true if this is a number

    Definition Classes
    JsValue
  10. abstract def isStr: Boolean

    returns true if this is a string

    returns true if this is a string

    Definition Classes
    JsValue
  11. abstract def toJsArray: 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.

    Definition Classes
    JsValue
    Annotations
    @throws( classOf[value.UserError] )
  12. abstract def toJsBigDec: 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.

    Definition Classes
    JsValue
    Annotations
    @throws( classOf[value.UserError] )
  13. abstract def toJsBigInt: 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.

    Definition Classes
    JsValue
    Annotations
    @throws( classOf[value.UserError] )
  14. abstract def toJsBool: 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.

    Definition Classes
    JsValue
    Annotations
    @throws( classOf[value.UserError] )
  15. abstract def toJsDouble: 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.

    Definition Classes
    JsValue
    Annotations
    @throws( classOf[value.UserError] )
  16. abstract def toJsInt: 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.

    Definition Classes
    JsValue
    Annotations
    @throws( classOf[value.UserError] )
  17. abstract def toJsLong: JsLong

    returns this value as a JsLong if it is a JsLong or a JsInt, throwing an UserError otherwise.

    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.

    Definition Classes
    JsValue
    Annotations
    @throws( classOf[value.UserError] )
  18. abstract def toJsNull: 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.

    Definition Classes
    JsValue
    Annotations
    @throws( classOf[value.UserError] )
  19. abstract def toJsNumber: 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 invocation to this function doesn't fail. The guard condition isNumber can help to that purpose.

    Definition Classes
    JsValue
    Annotations
    @throws( classOf[value.UserError] )
  20. abstract def toJsObj: 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.

    Definition Classes
    JsValue
    Annotations
    @throws( classOf[value.UserError] )
  21. abstract def toJsStr: 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.

    Definition Classes
    JsValue
    Annotations
    @throws( classOf[value.UserError] )
  22. abstract def toJson: 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.

    Definition Classes
    JsValue
    Annotations
    @throws( classOf[value.UserError] )

Concrete Value Members

  1. def isArr: Boolean

    returns true if this is an array

    returns true if this is an array

    Definition Classes
    JsPrimitiveJsValue
  2. 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
  3. 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
  4. def isDecimal: Boolean

    returns true if this type is a decimal number

    returns true if this type is a decimal number

    returns

    isDouble || isBigDec

    Definition Classes
    JsValue
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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
  12. 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
  13. def isNotNull: Boolean

    returns true if this is not null

    returns true if this is not null

    Definition Classes
    JsValue
  14. def isNotNumber: Boolean

    returns true if this is not a number

    returns true if this is not a number

    Definition Classes
    JsValue
  15. def isNothing: Boolean

    returns true if this is JsNothing

    returns true if this is JsNothing

    Definition Classes
    JsPrimitiveJsValue
  16. def isObj: Boolean

    returns true if this is an object

    returns true if this is an object

    Definition Classes
    JsPrimitiveJsValue
  17. 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
  18. def isPrimitive: Boolean

    returns true is this is a primitive type

    returns true is this is a primitive type

    Definition Classes
    JsPrimitiveJsValue
  19. 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
  20. def toJsPrimitive: JsPrimitive
    Definition Classes
    JsPrimitiveJsValue