CompoundWrite class final

An immutable tree of complete writes (nodes) at paths; a write shadows writes below it.

Constructors

CompoundWrite(ImmutableTree<Node> writeTree)
Wraps writeTree.
const
CompoundWrite.fromChildMerge(Map<ChildKey, Node> merge)
A write of one node per child key.
factory
CompoundWrite.fromPathMerge(Map<Path, Node> merge)
A write of one node per relative path.
factory
CompoundWrite.fromValue(Map<String, Object?> merge)
A write of a JSON update map whose keys are relative paths.
factory

Properties

entries → Iterable<MapEntry<Path, Node>>
Every write with its path.
no setter
hashCode → int
The hash code for this object.
no setteroverride
isEmpty → bool
Whether nothing is written.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
writeTree → ImmutableTree<Node>
The tree of written nodes.
final

Methods

addChildWrite(ChildKey key, Node node) → CompoundWrite
This write with node written at child key.
addWrite(Path path, Node node) → CompoundWrite
This write with node written at path.
addWrites(Path path, CompoundWrite updates) → CompoundWrite
This write with every write of updates added below path.
apply(Node node) → Node
node with every write applied.
childCompoundWrite(Path path) → CompoundWrite
The part of this write below path, relative to it.
childCompoundWrites() → Map<ChildKey, CompoundWrite>
The writes per immediate child.
getCompleteChildren() → List<NamedNode>
The complete children written directly at the root.
getCompleteNode(Path path) → Node?
The complete node at path if a write covers it, or null.
hasCompleteWrite(Path path) → bool
Whether path is covered by a complete write.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeWrite(Path path) → CompoundWrite
This write without the writes at and below path.
rootWrite() → Node?
The write at the root, or null.
toJson({bool exportFormat = false}) → Map<String, Object?>
The writes as a JSON map from path strings to values (export form when exportFormat).
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Properties

empty → CompoundWrite
The empty write.
no setter