Stores and retrieves aggregate state with optimistic locking.
The repository returns the version of fetched state. Saves can use that version to reject updates when the stored state changed concurrently.
C: command typeS: state typeV: version typeCM: command metadata typeSM: state metadata type
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
fetchState(
C command) → Future< (S?, V?)> -
Returns the state associated with
commandand its current version. -
fetchStateWithMetadata(
C command) → Future< (S?, V?, SM)> -
Returns the state, current version, and metadata for
command. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
save(
S state, V? currentStateVersion) → Future< (S, V)> -
Persists
stateifcurrentStateVersionstill matches storage. -
saveWithMetadata(
S state, V? currentStateVersion, CM metadata) → Future< (S, V, SM)> -
Persists
statewithmetadataif the version still matches storage. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited