@FunctionalInterface public static interface EventSourcingSpec.UndoFunction<A,K,C>
Modifier and Type | Method and Description |
---|---|
Optional<A> |
apply(K aggregateKey,
C command)
The UndoFunction is a mechanism to take the result of the async invocation and turning it into an
undo action command.
|
Optional<A> apply(K aggregateKey, C command)
The return value of type A must satisfy the following property:
Whatever value command
tranforms the aggregate to, if one takes the result of the UndoFunction.apply
,
decode it, and then apply it to this new aggregate value, it should result in the original aggregate value being restored.
Note that the undo command of an event sourcing action processor must have the same action type.
aggregateKey
- the aggregate keycommand
- the Simple Sourcing commandA
, or Optional.empty()
if no undo function is to be generatedCopyright © 2019. All rights reserved.