MergeContract class
CRDT mapping configuration for automatic generation or external references.
Defines how property-level CRDT merge strategies are specified for a root resource. CRDT mappings are RDF documents that declare which merge algorithm (LWW, OR-Set, etc.) should be used for each property when conflicts occur during synchronization.
Two modes are supported:
Generated CRDT mappings (default constructor):
MergeContracts(
'https://myapp.example.com/mappings/note-v1#',
label: 'Note CRDT Mapping',
imports: [MergeContracts.coreV1],
)
The builder scans @CrdtLwwRegister, @CrdtOrSet, @CrdtImmutable annotations
on properties and generates a CRDT mapping document with merge rules.
External CRDT mappings (.external() constructor):
MergeContract.external('https://vocab.example.org/mappings/standard-note-v1#')
References a manually authored or third-party CRDT mapping document. The builder does not generate merge rules for this resource; the mapping must be provided separately.
Constructors
Properties
- comment → String?
-
Optional human-readable comment for generated CRDT mapping metadata.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
imports
→ List<
IriTerm> -
Imported CRDT mapping documents for generated
mc:DocumentMapping.final - label → String?
-
Optional human-readable label for generated CRDT mapping metadata.
final
- path → String?
-
Optional path component for generated merge contract IRI.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- version → String
-
Version identifier for the merge contract (e.g., 'v1', 'v2').
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited