Str

fabric.Str
See theStr companion object
case class Str(value: String, reference: Option[Any]) extends Json

Str represents a String

Attributes

Companion
object
Source
Json.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Json
class Object
trait Matchable
class Any
Show all

Members list

Type members

Types

override type Type = Str

Attributes

Source
Json.scala

Value members

Concrete methods

override def `type`: JsonType[Str]

The type of value

The type of value

Attributes

Definition Classes
Source
Json.scala
override 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.

Type parameters

V

the return type

Value parameters

`type`

the type to cast this JsonType as

Attributes

Definition Classes
Source
Json.scala
override def equals(obj: Any): Boolean

Compares the receiver object (this) with the argument object (that) for equivalence.

Compares the receiver object (this) with the argument object (that) for equivalence.

Any implementation of this method should be an equivalence relation:

- It is reflexive: for any instance x of type Any, x.equals(x) should return true. - It is symmetric: for any instances x and y of type Any, x.equals(y) should return true if and only if y.equals(x) returns true. - It is transitive: for any instances x, y, and z of type Any if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.

If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is usually necessary to override hashCode to ensure that objects which are "equal" (o1.equals(o2) returns true) hash to the same scala.Int. (o1.hashCode.equals(o2.hashCode)).

Value parameters

that

the object to compare against this object for equality.

Attributes

Returns

true if the receiver object is equivalent to the argument; false otherwise.

Definition Classes
Equals -> Any
Source
Json.scala
override def genKey(b: StringBuilder): Unit

Generates a consistent key from this JSON.

Generates a consistent key from this JSON. This can be useful for comparison or unique reference.

Attributes

Definition Classes
Source
Json.scala
override def isEmpty: Boolean

Attributes

Definition Classes
Source
Json.scala
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any
Source
Json.scala

Inherited methods

final def apply(path: JsonPath): Json

Looks up a Json based on Path

Looks up a Json based on Path

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

Attributes

Inherited from:
Json
Source
Json.scala
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

Attributes

Inherited from:
Json
Source
Json.scala
def asArr: Arr

Casts to Arr or throws an exception if not an Arr

Casts to Arr or throws an exception if not an Arr

Attributes

Inherited from:
Json
Source
Json.scala

Convenience method for asNum.value

Convenience method for asNum.value

Attributes

Inherited from:
Json
Source
Json.scala
def asBool: Bool

Casts to Bool or throws an exception if not a Bool

Casts to Bool or throws an exception if not a Bool

Attributes

Inherited from:
Json
Source
Json.scala

Convenience method for asBool.value

Convenience method for asBool.value

Attributes

Inherited from:
Json
Source
Json.scala
def asByte: Byte

Attributes

Inherited from:
Json
Source
Json.scala

Attributes

Inherited from:
Json
Source
Json.scala
def asFloat: Float

Attributes

Inherited from:
Json
Source
Json.scala
def asInt: Int

Attributes

Inherited from:
Json
Source
Json.scala
def asLong: Long

Attributes

Inherited from:
Json
Source
Json.scala
def asMap: Map[String, Json]

Convenience method for asObj.value

Convenience method for asObj.value

Attributes

Inherited from:
Json
Source
Json.scala
def asNum: Num

Casts to Num or throws an exception if not a Num

Casts to Num or throws an exception if not a Num

Attributes

Inherited from:
Json
Source
Json.scala

Casts to NumDec or throws an exception if not a NumDec

Casts to NumDec or throws an exception if not a NumDec

Attributes

Inherited from:
Json
Source
Json.scala

Casts to NumInt or throws an exception if not a NumInt

Casts to NumInt or throws an exception if not a NumInt

Attributes

Inherited from:
Json
Source
Json.scala
def asObj: Obj

Casts to Obj or throws an exception if not an Obj

Casts to Obj or throws an exception if not an Obj

Attributes

Inherited from:
Json
Source
Json.scala
def asShort: Short

Attributes

Inherited from:
Json
Source
Json.scala
def asStr: Str

Casts to Str or throws an exception if not a Str

Casts to Str or throws an exception if not a Str

Attributes

Inherited from:
Json
Source
Json.scala

Convenience method for asStr.value

Convenience method for asStr.value

Attributes

Inherited from:
Json
Source
Json.scala

Convenience method for asArr.value

Convenience method for asArr.value

Attributes

Inherited from:
Json
Source
Json.scala
final 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.

Value parameters

filter

the filter to apply

Attributes

Returns

Option[Json]

Inherited from:
Json
Source
Json.scala
final def filterOne(filter: JsonFilter): Json

Attributes

Inherited from:
Json
Source
Json.scala
final def get(path: JsonPath): 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")

Attributes

Inherited from:
Json
Source
Json.scala
final def get(lookup: JsonPathEntry): Option[Json]

Attributes

Inherited from:
Json
Source
Json.scala
final def get(lookup: String): Option[Json]

Looks up a Json by name in the children.

Looks up a Json by name in the children.

Attributes

Inherited from:
Json
Source
Json.scala
def getArr: Option[Arr]

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

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

Attributes

Inherited from:
Json
Source
Json.scala
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.

Type parameters

V

the value type

Value parameters

`type`

the value type of value you want.

Attributes

Returns

Option[V]

Inherited from:
Json
Source
Json.scala

Convenience method for getNum.map(_.value)

Convenience method for getNum.map(_.value)

Attributes

Inherited from:
Json
Source
Json.scala

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

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

Attributes

Inherited from:
Json
Source
Json.scala

Convenience method for getBool.map(_.value)

Convenience method for getBool.map(_.value)

Attributes

Inherited from:
Json
Source
Json.scala

Attributes

Inherited from:
Json
Source
Json.scala

Attributes

Inherited from:
Json
Source
Json.scala

Attributes

Inherited from:
Json
Source
Json.scala
def getInt: Option[Int]

Attributes

Inherited from:
Json
Source
Json.scala

Attributes

Inherited from:
Json
Source
Json.scala

Convenience method for getObj.map(_.value)

Convenience method for getObj.map(_.value)

Attributes

Inherited from:
Json
Source
Json.scala
def getNum: Option[Num]

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

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

Attributes

Inherited from:
Json
Source
Json.scala
def getObj: Option[Obj]

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

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

Attributes

Inherited from:
Json
Source
Json.scala
final def getOrCreate(lookup: JsonPathEntry): Json

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

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

Attributes

Inherited from:
Json
Source
Json.scala

Attributes

Inherited from:
Json
Source
Json.scala
def getStr: Option[Str]

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

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

Attributes

Inherited from:
Json
Source
Json.scala

Convenience method for getStr.map(_.value)

Convenience method for getStr.map(_.value)

Attributes

Inherited from:
Json
Source
Json.scala

Convenience method for getArr.map(_.value)

Convenience method for getArr.map(_.value)

Attributes

Inherited from:
Json
Source
Json.scala
def isArr: Boolean

True if this is an Arr

True if this is an Arr

Attributes

Inherited from:
Json
Source
Json.scala

True if this is a Bool

True if this is a Bool

Attributes

Inherited from:
Json
Source
Json.scala

True if this is a Null

True if this is a Null

Attributes

Inherited from:
Json
Source
Json.scala
def isNum: Boolean

True if this is a Num

True if this is a Num

Attributes

Inherited from:
Json
Source
Json.scala

Attributes

Inherited from:
Json
Source
Json.scala

Attributes

Inherited from:
Json
Source
Json.scala
def isObj: Boolean

True if this is an Obj

True if this is an Obj

Attributes

Inherited from:
Json
Source
Json.scala
def isStr: Boolean

True if this is a Str

True if this is a Str

Attributes

Inherited from:
Json
Source
Json.scala
final def merge(value: Json, path: JsonPath, config: MergeConfig): Json

Merges a Json at the specified path

Merges a Json at the specified path

Value parameters

config

the merge configuration (defaults to MergeConfig)

path

the path (defaults to Path.empty)

value

the value to merge

Attributes

Returns

root Json after merge

Inherited from:
Json
Source
Json.scala
def modify(path: JsonPath)(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.

Value parameters

f

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

path

the path to modify

Attributes

Returns

new root Json representing the changes

Inherited from:
Json
Source
Json.scala

Attributes

Inherited from:
Json
Source
Json.scala

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product
def remove(path: JsonPath): 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.

Value parameters

path

the path to remove

Attributes

Returns

new root Json representing the changes

Inherited from:
Json
Source
Json.scala
def search(entries: SearchEntry*): List[JsonPath]

Attributes

Inherited from:
Json
Source
Json.scala
def set(path: JsonPath, 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.

Value parameters

path

the path to replace

value

the new value to set

Attributes

Returns

new root Json representing the changes

Inherited from:
Json
Source
Json.scala
def toKey: String

Generates a consistent key from this JSON.

Generates a consistent key from this JSON. This can be useful for comparison or unique reference. Convenience wrapper for genKey.

Attributes

Inherited from:
Json
Source
Json.scala
def transform(search: Search): Transformer

Attributes

Inherited from:
Json
Source
Json.scala