Class AnnotationCommandTargetResolver.Builder
java.lang.Object
org.axonframework.modelling.command.AnnotationCommandTargetResolver.Builder
- Enclosing class:
AnnotationCommandTargetResolver
Builder class to instantiate a
AnnotationCommandTargetResolver.
The TargetAggregateIdentifierAnnotation is defaulted to TargetAggregateIdentifier,
TargetAggregateVersionAnnotation to TargetAggregateVersion.
- Author:
- JohT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Initializes aAnnotationCommandTargetResolveras specified through this Builder.targetAggregateIdentifierAnnotation(Class<? extends Annotation> annotation) Sets the annotation, that marks the target aggregate identifier.targetAggregateVersionAnnotation(Class<? extends Annotation> annotation) Sets the annotation, that marks the target aggregate version.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
targetAggregateIdentifierAnnotation
public AnnotationCommandTargetResolver.Builder targetAggregateIdentifierAnnotation(Class<? extends Annotation> annotation) Sets the annotation, that marks the target aggregate identifier.Defaults to
TargetAggregateIdentifier.
Use this method if you use another annotation to mark the field or method that identifies the target aggregate, and it is not possible to put @
TargetAggregateIdentifierinto that annotation (to use it as meta-annotation).- Parameters:
annotation-Classof typeAnnotation.- Returns:
- the current
AnnotationCommandTargetResolver.Builderinstance, for fluent interfacing
-
targetAggregateVersionAnnotation
public AnnotationCommandTargetResolver.Builder targetAggregateVersionAnnotation(Class<? extends Annotation> annotation) Sets the annotation, that marks the target aggregate version.Defaults to
TargetAggregateVersion.Use this method if you use another annotation to mark the field or method that identifies the version of the aggregate, and it is not possible to put @
TargetAggregateVersioninto that annotation (to use it as meta-annotation).- Parameters:
annotation-Classof typeAnnotation.- Returns:
- the current
AnnotationCommandTargetResolver.Builderinstance, for fluent interfacing
-
build
Initializes aAnnotationCommandTargetResolveras specified through this Builder.- Returns:
- a
AnnotationCommandTargetResolveras specified through this Builder
-