Class

org.json4s

MonadicJValue

Related Doc: package json4s

Permalink

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
Visibility
  1. Public
  2. All

Instance Constructors

  1. new MonadicJValue(jv: JValue)

    Permalink

Type Members

  1. class JValueWithFilter extends AnyRef

    Permalink

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. def \[A <: JValue](clazz: Class[A]): List[\.A.Values]

    Permalink

    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]
    

  5. def \(nameToFind: String): JValue

    Permalink

    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"
    

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

    Permalink

    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]
    

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

    Permalink

    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"
    

  8. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  9. def camelizeKeys: JValue

    Permalink

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

  10. def clone(): AnyRef

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

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

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

    Permalink

    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 }
    

  14. def filterField(p: (JField) ⇒ Boolean): List[JField]

    Permalink

    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
    }
    

  15. def finalize(): Unit

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

    Permalink

    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))
    

  17. def findField(p: (JField) ⇒ Boolean): Option[JField]

    Permalink

    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" }
    

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

    Permalink

    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.

  19. def foldField[A](z: A)(f: (A, JField) ⇒ A): A

    Permalink

    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.

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

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

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

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

    Permalink

    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
    }
    

  24. def mapField(f: (JField) ⇒ JField): JValue

    Permalink

    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
    }
    

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

    Permalink
    Definition Classes
    AnyRef
  26. def noNulls: JValue

    Permalink

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

  27. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  28. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  29. def pascalizeKeys: JValue

    Permalink

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

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

    Permalink

    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 }
    

  31. def removeField(p: (JField) ⇒ Boolean): JValue

    Permalink

    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
    }
    

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

    Permalink

    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 or JArray instance. If the path is a JArray you must use the following annotation "foo[]", each element, or foo[index], one element.

    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")))))))
    
    JObject(List(JField("foo", JArray(List(JObject(List(JField("bar", JInt(1)))), JObject(List(JField("bar", JInt(2))))))))).replace("foo[]" :: "bar" :: Nil, JString("baz"))
    // returns JObject(List((foo,JArray(List(JObject(List((bar,JString(baz)))), JObject(List((bar,JString(baz)))))))))
    
    JObject(List(JField("foo", JArray(List(JObject(List(JField("bar", JInt(1)))), JObject(List(JField("bar", JInt(2))))))))).replace("foo[0]" :: "bar" :: Nil, JString("baz"))
    // returns JObject(List((foo,JArray(List(JObject(List((bar,JString(baz)))), JObject(List((bar,JInt(2)))))))))
    

  33. def snakizeKeys: JValue

    Permalink

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

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

    Permalink
    Definition Classes
    AnyRef
  35. def toString(): String

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

    Permalink

    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) }
    

  37. def transformField(f: PartialFunction[JField, JField]): JValue

    Permalink

    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))
    }
    

  38. def underscoreCamelCaseKeysOnly: JValue

    Permalink

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

  39. def underscoreKeys: JValue

    Permalink

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

  40. final def wait(): Unit

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

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

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

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped