@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface Apply
As we apply the event to the aggregate state, we call such a method Event Applier.
An event applier method:
Apply
;
private
;
void
;
EventMessage
as the only parameter.
To update the state of the aggregate, the Aggregate.builder()
method
should be used.
If the annotation comes with the attribute allowImport
set to
true
, the aggregate can receive incoming events as if they were produced
by the aggregate.
Modifier and Type | Optional Element and Description |
---|---|
boolean |
allowImport
If
true the aggregate supports importing of events with the messages
defined as the first parameter of the annotated method. |