GCounter class
CRDT types for conflict-free distributed data. Supports counters, sets, maps, and registers with automatic conflict resolution. G-Counter (Grow-only counter) - can only increment. Each node maintains its own count. The total value is the sum of all node counts. Merge takes the maximum per node.
Properties
Methods
-
countFor(
String nodeId) → int - Get the count for a specific node.
-
increment(
[int amount = 1]) → void -
Increment this node's counter by
amount(default 1). -
merge(
GCounter other) → GCounter - Merge with another G-Counter by taking the max per node.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Serialize to a JSON-serializable map.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited