T
- a generic specifying the Aggregate type contained in this Repository
implementationpublic abstract static class AbstractRepository.Builder<T> extends Object
AbstractRepository
implementations.
This Builder's main goal is to build an AggregateModel
specifying generic T
as the aggregate
type to be stored. All aggregates in this repository must be instanceOf
this aggregate type. To
instantiate this AggregateModel, either an AggregateModel
can be provided directly or an
aggregateType
of type Class
can be used. The latter will internally resolve to an
AggregateModel. Thus, either the AggregateModel or the aggregateType
should be provided.
Modifier and Type | Field and Description |
---|---|
protected Class<T> |
aggregateType |
Modifier | Constructor and Description |
---|---|
protected |
Builder(Class<T> aggregateType)
Creates a builder for a Repository for given
aggregateType . |
Modifier and Type | Method and Description |
---|---|
AbstractRepository.Builder<T> |
aggregateModel(AggregateModel<T> aggregateModel)
Sets the
AggregateModel of generic type T , describing the structure of the aggregate this
Repository will store. |
protected AggregateModel<T> |
buildAggregateModel()
Instantiate the
AggregateModel of generic type T describing the structure of the Aggregate
this Repository will store. |
AbstractRepository.Builder<T> |
handlerDefinition(HandlerDefinition handlerDefinition)
Sets the
HandlerDefinition used to create concrete handlers for the given aggregateType . |
AbstractRepository.Builder<T> |
parameterResolverFactory(ParameterResolverFactory parameterResolverFactory)
Sets the
ParameterResolverFactory used to resolve parameters for annotated handlers contained in the
Aggregate. |
protected void |
validate()
Validates whether the fields contained in this Builder are set accordingly.
|
protected Builder(Class<T> aggregateType)
aggregateType
.aggregateType
- the aggregateType
specifying the type of aggregate this Repository
will
storepublic AbstractRepository.Builder<T> parameterResolverFactory(ParameterResolverFactory parameterResolverFactory)
ParameterResolverFactory
used to resolve parameters for annotated handlers contained in the
Aggregate. Only used if the aggregateType
approach is selected to create an AggregateModel
.parameterResolverFactory
- a ParameterResolverFactory
used to resolve parameters for annotated
handlers contained in the Aggregatepublic AbstractRepository.Builder<T> handlerDefinition(HandlerDefinition handlerDefinition)
HandlerDefinition
used to create concrete handlers for the given aggregateType
.
Only used if the aggregateType
approach is selected to create an AggregateModel
.handlerDefinition
- a HandlerDefinition
used to create concrete handlers for the given
aggregateType
.public AbstractRepository.Builder<T> aggregateModel(AggregateModel<T> aggregateModel)
AggregateModel
of generic type T
, describing the structure of the aggregate this
Repository
will store.aggregateModel
- the AggregateModel
of generic type T
of the aggregate this
Repository
will storeprotected AggregateModel<T> buildAggregateModel()
AggregateModel
of generic type T
describing the structure of the Aggregate
this Repository
will store.AggregateModel
of generic type T
describing the Aggregate this Repository
will storeprotected void validate() throws AxonConfigurationException
AxonConfigurationException
- if one field is asserted to be incorrect according to the Builder's
specificationsCopyright © 2010–2018. All rights reserved.