Class NoArgumentConstructorCreationPolicyAggregateFactory<A>

java.lang.Object
org.axonframework.modelling.command.NoArgumentConstructorCreationPolicyAggregateFactory<A>
Type Parameters:
A - The aggregate type this factory constructs.
All Implemented Interfaces:
CreationPolicyAggregateFactory<A>

public class NoArgumentConstructorCreationPolicyAggregateFactory<A> extends Object implements CreationPolicyAggregateFactory<A>
Default implementation of CreationPolicyAggregateFactory that invokes the default, no-arguments constructor of the aggregate class A.
Since:
4.6.0
Author:
Stefan Andjelkovic
  • Constructor Details

    • NoArgumentConstructorCreationPolicyAggregateFactory

      public NoArgumentConstructorCreationPolicyAggregateFactory(@Nonnull Class<? extends A> aggregateClass)
      Construct an instance of the NoArgumentConstructorCreationPolicyAggregateFactory for the given type.
      Parameters:
      aggregateClass - The aggregate type.
  • Method Details

    • create

      @Nonnull public A create(@Nullable Object identifier)
      Creates the aggregate instance based on the previously provided type. Invokes the default, no-argument constructor of the class.
      Specified by:
      create in interface CreationPolicyAggregateFactory<A>
      Parameters:
      identifier - The identifier to create the aggregate with. Not used by this factory.
      Returns:
      An aggregate instance.