org.json4s

MonadicJValue

class MonadicJValue extends AnyRef

Source
MonadicJValue.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. MonadicJValue
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new MonadicJValue(jv: JValue)

Type Members

  1. class JValueWithFilter extends AnyRef

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def \[A <: JValue](clazz: Class[A]): List[\.A.Values]

    XPath-like expression to query JSON fields by type.

    XPath-like expression to query JSON fields by type. Matches only fields on next level.

    Example:

    json \ classOf[JInt]
    

  7. def \(nameToFind: String): JValue

    XPath-like expression to query JSON fields by name.

    XPath-like expression to query JSON fields by name. Matches only fields on next level.

    Example:

    json \ "name"
    

  8. def \\[A <: JValue](clazz: Class[A]): List[\\.A.Values]

    XPath-like expression to query JSON fields by type.

    XPath-like expression to query JSON fields by type. Returns all matching fields.

    Example:

    json \\ classOf[JInt]
    

  9. def \\(nameToFind: String): JValue

    XPath-like expression to query JSON fields by name.

    XPath-like expression to query JSON fields by name. Returns all matching fields.

    Example:

    json \\ "name"
    

  10. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  11. def camelizeKeys: JValue

    Camelize all the keys in this org.

    Camelize all the keys in this org.json4s.JsonAST.JValue

  12. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  15. def filter(p: (JValue) ⇒ Boolean): List[JValue]

    Return a List of all values which matches the given predicate.

    Return a List of all values which matches the given predicate.

    Example:

    JArray(JInt(1) :: JInt(2) :: Nil) filter { case JInt(x) => x > 1; case _ => false }
    

  16. def filterField(p: ((String, JsonAST.JValue)) ⇒ Boolean): List[(String, JsonAST.JValue)]

    Return a List of all fields which matches the given predicate.

    Return a List of all fields which matches the given predicate.

    Example:

    JObject(("age", JInt(10)) :: Nil) filterField {
      case ("age", JInt(x)) if x > 18 => true
      case _          => false
    }
    

  17. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. def find(p: (JValue) ⇒ Boolean): Option[JValue]

    Return the first element from JSON which matches the given predicate.

    Return the first element from JSON which matches the given predicate.

    Example:

    JArray(JInt(1) :: JInt(2) :: Nil) find { _ == JInt(2) } == Some(JInt(2))
    

  19. def findField(p: ((String, JsonAST.JValue)) ⇒ Boolean): Option[(String, JsonAST.JValue)]

    Return the first field from JSON which matches the given predicate.

    Return the first field from JSON which matches the given predicate.

    Example:

    JObject(("age", JInt(2))) findField { case (n, v) => n == "age" }
    

  20. def fold[A](z: A)(f: (A, JValue) ⇒ A): A

    Return a combined value by folding over JSON by applying a function f for each element.

    Return a combined value by folding over JSON by applying a function f for each element. The initial value is z.

  21. def foldField[A](z: A)(f: (A, (String, JsonAST.JValue)) ⇒ A): A

    Return a combined value by folding over JSON by applying a function f for each field.

    Return a combined value by folding over JSON by applying a function f for each field. The initial value is z.

  22. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  23. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  24. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  25. def map(f: (JValue) ⇒ JValue): JValue

    Return a new JValue resulting from applying the given function f to each value in JSON.

    Return a new JValue resulting from applying the given function f to each value in JSON.

    Example:

    JArray(JInt(1) :: JInt(2) :: Nil) map {
      case JInt(x) => JInt(x+1)
      case x => x
    }
    

  26. def mapField(f: ((String, JsonAST.JValue)) ⇒ (String, JsonAST.JValue)): JValue

    Return a new JValue resulting from applying the given function f to each field in JSON.

    Return a new JValue resulting from applying the given function f to each field in JSON.

    Example:

    JObject(("age", JInt(10)) :: Nil) mapField {
      case ("age", JInt(x)) => ("age", JInt(x+1))
      case x => x
    }
    

  27. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  28. def noNulls: JValue

    Remove the org.

    Remove the org.json4s.JsonAST.JNothing and org.json4s.JsonAST.JNull from a org.json4s.JsonAST.JArray or org.json4s.JsonAST.JObject

  29. final def notify(): Unit

    Definition Classes
    AnyRef
  30. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  31. def pascalizeKeys: JValue

    Pascalize all the keys in this org.

    Pascalize all the keys in this org.json4s.JsonAST.JValue

  32. def remove(p: (JValue) ⇒ Boolean): JValue

    Return a JSON where all values matching the given predicate are removed.

    Return a JSON where all values matching the given predicate are removed.

    Example:

    JArray(JInt(1) :: JInt(2) :: JNull :: Nil) remove { _ == JNull }
    

  33. def removeField(p: ((String, JsonAST.JValue)) ⇒ Boolean): JValue

    Return a JSON where all fields matching the given predicate are removed.

    Return a JSON where all fields matching the given predicate are removed.

    Example:

    JObject(("age", JInt(10)) :: Nil) removeField {
      case ("age", _) => true
      case _          => false
    }
    

  34. def replace(l: List[String], replacement: JValue): JValue

    Return a new JValue resulting from replacing the value at the specified field path with the replacement value provided.

    Return a new JValue resulting from replacing the value at the specified field path with the replacement value provided. This has no effect if the path is empty or if the value is not a JObject instance.

    Example:

    JObject(List(JField("foo", JObject(List(JField("bar", JInt(1))))))).replace("foo" :: "bar" :: Nil, JString("baz"))
    // returns JObject(List(JField("foo", JObject(List(JField("bar", JString("baz")))))))
    

  35. def snakizeKeys: JValue

    Underscore all the keys in this org.

    Underscore all the keys in this org.json4s.JsonAST.JValue

  36. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  37. def toString(): String

    Definition Classes
    AnyRef → Any
  38. def transform(f: PartialFunction[JValue, JValue]): JValue

    Return a new JValue resulting from applying the given partial function f to each value in JSON.

    Return a new JValue resulting from applying the given partial function f to each value in JSON.

    Example:

    JArray(JInt(1) :: JInt(2) :: Nil) transform { case JInt(x) => JInt(x+1) }
    

  39. def transformField(f: PartialFunction[(String, JsonAST.JValue), (String, JsonAST.JValue)]): JValue

    Return a new JValue resulting from applying the given partial function f to each field in JSON.

    Return a new JValue resulting from applying the given partial function f to each field in JSON.

    Example:

    JObject(("age", JInt(10)) :: Nil) transformField {
      case ("age", JInt(x)) => ("age", JInt(x+1))
    }
    

  40. def underscoreCamelCaseKeysOnly: JValue

    Underscore the camel cased only keys in this org.json4s.JsonAST.JValue

  41. def underscoreKeys: JValue

    Underscore all the keys in this org.

    Underscore all the keys in this org.json4s.JsonAST.JValue

  42. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  43. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  45. def withFilter(p: (JValue) ⇒ Boolean): JValueWithFilter

Inherited from AnyRef

Inherited from Any

Ungrouped