JValue

org.json4s.JValue
See theJValue companion object
sealed abstract class JValue extends Product, Serializable

Data type for JSON AST.

Attributes

Companion
object
Source
JValue.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Known subtypes
class JArray
class JBool
class JDecimal
class JDouble
class JInt
class JLong
object JNothing
object JNull
trait JNumber
class JObject
class JSet
class JString
Show all

Members list

Type members

Types

type Values

Attributes

Source
JValue.scala

Value members

Abstract methods

def values: Values

Return unboxed values from JSON

Return unboxed values from JSON

Example:

JObject(JField("name", JString("joe")) :: Nil).values == Map("name" -> "joe")

Attributes

Source
JValue.scala

Concrete methods

def ++(other: JValue): JValue

Concatenate with another JSON. This is a concatenation monoid: (JValue, ++, JNothing)

Concatenate with another JSON. This is a concatenation monoid: (JValue, ++, JNothing)

Example:

JArray(JInt(1) :: JInt(2) :: Nil) ++ JArray(JInt(3) :: Nil) ==
JArray(List(JInt(1), JInt(2), JInt(3)))

Attributes

Source
JValue.scala
def apply(i: Int): JValue

Return nth element from JSON. Meaningful only to JArray, JObject and JField. Returns JNothing for other types.

Return nth element from JSON. Meaningful only to JArray, JObject and JField. Returns JNothing for other types.

Example:

JArray(JInt(1) :: JInt(2) :: Nil)(1) == JInt(2)

Attributes

Source
JValue.scala
def children: List[JValue]

Return direct child elements.

Return direct child elements.

Example:

JArray(JInt(1) :: JInt(2) :: Nil).children == List(JInt(1), JInt(2))

Attributes

Source
JValue.scala
def toOption: Option[JValue]

When this org.json4s.JValue is a org.json4s.JNothing or a org.json4s.JNull, this method returns scala.None When it has a value it will return scala.Some

When this org.json4s.JValue is a org.json4s.JNothing or a org.json4s.JNull, this method returns scala.None When it has a value it will return scala.Some

Attributes

Source
JValue.scala
def toSome: Option[JValue]

When this org.json4s.JValue is a org.json4s.JNothing, this method returns scala.None When it has a value it will return scala.Some

When this org.json4s.JValue is a org.json4s.JNothing, this method returns scala.None When it has a value it will return scala.Some

Attributes

Source
JValue.scala

Inherited methods

def canEqual(that: Any): Boolean

Attributes

Inherited from:
Equals
def diff(other: JValue): Diff

Return a diff.

Return a diff.

Attributes

See also

org.json4s.Diff#diff

Inherited from:
Diffable (hidden)
Source
Diff.scala
def productArity: Int

Attributes

Inherited from:
Product
def productElement(n: Int): Any

Attributes

Inherited from:
Product
def productElementName(n: Int): String

Attributes

Inherited from:
Product
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
def productPrefix: String

Attributes

Inherited from:
Product