Packages

sealed trait Json extends Any

Json represents the base sealed trait for all representable types in Fabric.

Source
Json.scala
Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Json
  2. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. abstract type Type

Abstract Value Members

  1. abstract def getClass(): Class[_]
    Definition Classes
    Any
  2. abstract def isEmpty: Boolean
  3. abstract def type: JsonType[Type]

    The type of value

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  2. final def ##(): Int
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
  4. final def apply(path: Path): Json

    Looks up a Json based on Path

    Looks up a Json based on Path

    Example: val v = someValue("first" \ "second" \ "third")

  5. final def apply(lookup: String): Json

    Looks up a Json by name in the children.

    Looks up a Json by name in the children.

    Throws an exception if invoked on anything except Obj

  6. def asArr: Arr

    Casts to Arr or throws an exception if not an Arr

  7. def asBigDecimal: BigDecimal

    Convenience method for asNum.value

  8. def asBool: Bool

    Casts to Bool or throws an exception if not a Bool

  9. def asBoolean: Boolean

    Convenience method for asBool.value

  10. def asByte: Byte
  11. def asDouble: Double
  12. def asFloat: Float
  13. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  14. def asInt: Int
  15. def asLong: Long
  16. def asMap: Map[String, Json]

    Convenience method for asObj.value

  17. def asNum: Num

    Casts to Num or throws an exception if not a Num

  18. def asNumDec: NumDec

    Casts to NumDec or throws an exception if not a NumDec

  19. def asNumInt: NumInt

    Casts to NumInt or throws an exception if not a NumInt

  20. def asObj: Obj

    Casts to Obj or throws an exception if not an Obj

  21. def asShort: Short
  22. def asStr: Str

    Casts to Str or throws an exception if not a Str

  23. def asString: String

    Convenience method for asStr.value

  24. def asType[V <: Json](type: JsonType[V]): V

    Safely casts this Json as the specified JsonType.

    Safely casts this Json as the specified JsonType. Throws an exception if not a match.

    V

    the return type

  25. def asVector: Vector[Json]

    Convenience method for asArr.value

  26. def equals(arg0: Any): Boolean
    Definition Classes
    Any
  27. def filter(filter: JsonFilter): Option[Json]

    Applies the filter recursively to this value beginning on the leafs working backward up the tree back to the root.

    Applies the filter recursively to this value beginning on the leafs working backward up the tree back to the root.

    filter

    the filter to apply

    returns

    Option[Json]

  28. final def get(path: Path): Option[Json]

    Looks up a Json based on Path

    Looks up a Json based on Path

    Example: val o: Option[Json] = someValue("first" \ "second" \ "third")

  29. final def get(lookup: String): Option[Json]

    Looks up a Json by name in the children.

  30. def getArr: Option[Arr]

    Casts to Arr if it's of Arr type or returns None

  31. final def getAsType[V <: Json](type: JsonType[V]): Option[V]

    Safely casts this Json as the specified JsonType.

    Safely casts this Json as the specified JsonType. Returns None if it's a different type.

    V

    the value type

    returns

    Option[V]

  32. def getBigDecimal: Option[BigDecimal]

    Convenience method for getNum.map(_.value)

  33. def getBool: Option[Bool]

    Casts to Bool if it's of Bool type or returns None

  34. def getBoolean: Option[Boolean]

    Convenience method for getBool.map(_.value)

  35. def getByte: Option[Byte]
  36. def getDouble: Option[Double]
  37. def getFloat: Option[Float]
  38. def getInt: Option[Int]
  39. def getLong: Option[Long]
  40. def getMap: Option[Map[String, Json]]

    Convenience method for getObj.map(_.value)

  41. def getNum: Option[Num]

    Casts to Num if it's of Num type or returns None

  42. def getObj: Option[Obj]

    Casts to Obj if it's of Obj type or returns None

  43. final def getOrCreate(lookup: String): Json

    Looks up a Json by name in the children or creates a new Obj if it doesn't exist.

  44. def getShort: Option[Short]
  45. def getStr: Option[Str]

    Casts to Str if it's of Str type or returns None

  46. def getString: Option[String]

    Convenience method for getStr.map(_.value)

  47. def getVector: Option[Vector[Json]]

    Convenience method for getArr.map(_.value)

  48. def hashCode(): Int
    Definition Classes
    Any
  49. def isArr: Boolean

    True if this is an Arr

  50. def isBool: Boolean

    True if this is a Bool

  51. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  52. def isNull: Boolean

    True if this is a Null

  53. def isNum: Boolean

    True if this is a Num

  54. def isNumDec: Boolean
  55. def isNumInt: Boolean
  56. def isObj: Boolean

    True if this is an Obj

  57. def isStr: Boolean

    True if this is a Str

  58. final def merge(value: Json, path: Path = Path.empty, config: MergeConfig = MergeConfig): Json

    Merges a Json at the specified path

    Merges a Json at the specified path

    value

    the value to merge

    path

    the path (defaults to Path.empty)

    config

    the merge configuration (defaults to MergeConfig)

    returns

    root Json after merge

  59. def modify(path: Path)(f: (Json) ⇒ Json): Json

    Modifies the value at the specified path and returns back a new root Json with the modified path.

    Modifies the value at the specified path and returns back a new root Json with the modified path.

    Note: We use the term "modify" here from an immutable standpoint. The original Json will not change.

    path

    the path to modify

    f

    the function that takes the current Json and returns the modified Json

    returns

    new root Json representing the changes

  60. def nonEmpty: Boolean
  61. def remove(path: Path): Json

    Convenience functionality for #modify to remove the value at a specific path.

    Convenience functionality for #modify to remove the value at a specific path.

    path

    the path to remove

    returns

    new root Json representing the changes

  62. def set(path: Path, value: Json): Json

    Convenience functionality for #modify to set a specific value at a path.

    Convenience functionality for #modify to set a specific value at a path.

    path

    the path to replace

    value

    the new value to set

    returns

    new root Json representing the changes

  63. def toString(): String
    Definition Classes
    Any

Inherited from Any

Ungrouped