Str

final case class Str(value: String) extends AnyVal with Value

Str represents a String

Str represents a String

Companion
object
trait Serializable
trait Product
trait Equals
trait Value
class AnyVal
trait Matchable
class Any

Value members

Concrete methods

override def `type`: ValueType
Definition Classes
override def isEmpty: Boolean
Definition Classes
override def toString: String
Definition Classes
Any

Inherited methods

final def apply(path: Path): Value

Looks up a Value based on Path

Looks up a Value based on Path

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

Inherited from
Value
final def apply(lookup: String): Value

Looks up a Value by name in the children.

Looks up a Value by name in the children.

Throws an exception if invoked on anything except Obj

Inherited from
Value
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

Inherited from
Value
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

Inherited from
Value
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

Inherited from
Value
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

Inherited from
Value
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

Inherited from
Value
def asValue[V <: Value](`type`: ValueType): V

Safely casts this Value as the specified ValueType. Throws an exception if not a match.

Safely casts this Value as the specified ValueType. Throws an exception if not a match.

Type Params
V

the return type

Value Params
`type`

the type to cast this ValueType as

Inherited from
Value
final def get(path: Path): Option[Value]

Looks up a Value based on Path

Looks up a Value based on Path

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

Inherited from
Value
final def get(lookup: String): Option[Value]

Looks up a Value by name in the children.

Looks up a Value by name in the children.

Inherited from
Value
final def getOrCreate(lookup: String): Value

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

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

Inherited from
Value
def isArr: Boolean

True if this is an Arr

True if this is an Arr

Inherited from
Value
def isBool: Boolean

True if this is a Bool

True if this is a Bool

Inherited from
Value
def isNull: Boolean

True if this is a Null

True if this is a Null

Inherited from
Value
def isNum: Boolean

True if this is a Num

True if this is a Num

Inherited from
Value
def isObj: Boolean

True if this is an Obj

True if this is an Obj

Inherited from
Value
def isStr: Boolean

True if this is a Str

True if this is a Str

Inherited from
Value
def merge(value: Value, path: Path, `type`: MergeType): Value

Merges a Value at the specified path

Merges a Value at the specified path

Value Params
`type`

the merge type (defaults to MergeType.Overwrite)

path

the path (defaults to Path.empty)

value

the value to merge

Returns

root Value after merge

Inherited from
Value
def modify(path: Path)(f: Value => Value): Value

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

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

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

Value Params
f

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

path

the path to modify

Returns

new root Value representing the changes

Inherited from
Value
def nonEmpty: Boolean
Inherited from
Value
def productElementNames: Iterator[String]
Inherited from
Product
def productIterator: Iterator[Any]
Inherited from
Product
def remove(path: Path): Value

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 Params
path

the path to remove

Returns

new root Value representing the changes

Inherited from
Value
def set(path: Path, value: Value): Value

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 Params
path

the path to replace

value

the new value to set

Returns

new root Value representing the changes

Inherited from
Value