Apply

Marks a method of an aggregate as one that modifies the state of the aggregate with data from the passed event.

As we apply the event to the aggregate state, we call such a method Event Applier.

An event applier method:

  • is annotated with Apply;
  • is private;
  • is void;
  • accepts an event derived from EventMessage as the only parameter.

To update the state of the aggregate, the 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.

Functions

Link copied to clipboard
public abstract boolean allowImport()
If true the aggregate supports importing of events with the messages defined as the first parameter of the annotated method.

Inherited functions

Link copied to clipboard
public abstract Class<? extends Annotation> annotationType()
Link copied to clipboard
public abstract boolean equals(Object p)
Link copied to clipboard
public abstract int hashCode()
Link copied to clipboard
public abstract String toString()