PatchBase<TEntity, TEnum extends Enum> class
abstract
The base every generated <Name>Patch extends (ISSUE-007).
It implements both patch surfaces: the legacy Patch entry point the
original patchWith resolves a carried field through, and the v3
ZorphyPatch algebra (isEmpty / apply / compose / invert /
toWire) the generated class fills in. Implementing ZorphyPatch here is
what lets a generated patch stand in for the SubPatch bound of
PatchNested — a nested field carries its sub-entity's own generated patch,
so that patch has to BE a ZorphyPatch of the sub-entity (ISSUE-008).
- Implemented types
-
- Patch<
TEntity> - ZorphyPatch<
TEntity>
- Patch<
- Available extensions
Constructors
-
PatchBase([Map<
TEnum, dynamic> ? patchMap]) -
Creates a patch holding
patchMap, or a fresh mutable map when it is omitted. - PatchBase.empty()
-
Creates a patch over a shared
constempty map.const
Properties
-
changedPaths
→ Set<
String> -
The JSON pointers this patch changes, e.g.
{'/price', '/title'}.no setter -
changedPaths
→ Set<
String> -
Available on ZorphyPatch<
Top-level JSON pointers changed by this patch.T> , provided by the ZorphyPatchAlgebra extensionno setter - hashCode → int
-
The hash code for this object.
no setterinherited
- isEmpty → bool
-
Whether this patch carries no change at all.
no setterinherited
- isNotEmpty → bool
-
Whether this patch carries at least one change.
no setteroverride
-
patchMap
→ Map<
TEnum, dynamic> -
The field-keyed changes this patch carries.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
apply(
TEntity target) → TEntity -
Returns
targetwith this patch applied.inherited -
applyTo(
TEntity entity) → TEntity -
Applies this patch to the given entity
inherited
-
compose(
covariant ZorphyPatch< TEntity> next) → ZorphyPatch<TEntity> -
Returns the patch that applies this patch first and then
next.inherited -
composePatches(
covariant ZorphyPatch< TEntity> next) → ZorphyPatch<TEntity> -
Applies
nextover this patch — the three-way-merge name for compose. -
composePatches(
ZorphyPatch< T> next) → ZorphyPatch<T> -
Available on ZorphyPatch<
Three-way name for compose, with the same left-to-right semantics.T> , provided by the ZorphyPatchAlgebra extension -
conflictingPaths(
PatchBase< TEntity, TEnum> other) → Set<String> -
The exact set of paths BOTH this patch and
otherchange — the conflict set a three-way sync surfaces asAppFailure.conflict. -
conflictingPaths(
ZorphyPatch< T> other) → Set<String> -
Available on ZorphyPatch<
The exact intersection of this patch's andT> , provided by the ZorphyPatchAlgebra extensionother's changed paths. -
invert(
TEntity before) → ZorphyPatch< TEntity> -
Returns the patch that undoes this one for a value that was
before.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
toPatch(
) → Map< TEnum, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
-
toWire(
) → Map< String, Object?> -
The wire form of this patch: the field changes it carries, keyed by the
field name they belong to.
inherited
-
wireNameFor(
TEnum key) → String -
The wire/field name a patch key addresses, e.g.
priceforPrice$.price.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited