Interface CreationPolicyAggregateFactory<A>

Type Parameters:
A - The type of aggregate this factory creates
All Known Implementing Classes:
NoArgumentConstructorCreationPolicyAggregateFactory
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface CreationPolicyAggregateFactory<A>
Interface to describe a way to create Aggregate instances based on an identifier when an instance has to be created in order to be used in Command handlers annotated with CreationPolicy.
Since:
4.6.0
Author:
Stefan Andjelkovic
  • Method Summary

    Modifier and Type
    Method
    Description
    create(Object identifier)
    Instantiates the aggregate instance based on the provided identifier.
  • Method Details

    • create

      @Nonnull A create(@Nullable Object identifier)
      Instantiates the aggregate instance based on the provided identifier. The identifier can be a null if no identifier is found or provided in the command message.
      Parameters:
      identifier - the identifier extracted from the command message
      Returns:
      an identifier initialized aggregate root instance ready to handle commands