Value represents the base sealed trait for all representable types in fabric.
- Companion
- object
Type members
Types
Value members
Abstract methods
Concrete methods
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
Looks up a Value based on Path
Looks up a Value based on Path
Example: val v = someValue("first" \ "second" \ "third")
Casts to Bool or throws an exception if not a Bool
Casts to Bool or throws an exception if not a Bool
Casts to NumDec or throws an exception if not a NumDec
Casts to NumDec or throws an exception if not a NumDec
Casts to NumInt or throws an exception if not a NumInt
Casts to NumInt or throws an exception if not a NumInt
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
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 Params
- filter
the filter to apply
- Returns
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")
Casts to Bool if it's of Bool type or returns None
Casts to Bool if it's of Bool type or returns None
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.
Safely casts this Value as the specified ValueType. Returns None if it's a different type.
Safely casts this Value as the specified ValueType. Returns None if it's a different type.
- Type Params
- V
the value type
- Value Params
- `type`
the value type of value you want.
- Returns
Option[V]
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
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