Class MapEntityChildMetamodel.Builder<K,C,P>
java.lang.Object
org.axonframework.modelling.entity.child.AbstractEntityChildMetamodel.Builder<C,P,MapEntityChildMetamodel.Builder<K,C,P>>
org.axonframework.modelling.entity.child.MapEntityChildMetamodel.Builder<K,C,P>
- Type Parameters:
K- the type of the key of theMapcontaining the child entitiesC- the type of the child entityP- the type of the parent entity
- Enclosing class:
MapEntityChildMetamodel<K,C, P>
public static class MapEntityChildMetamodel.Builder<K,C,P>
extends AbstractEntityChildMetamodel.Builder<C,P,MapEntityChildMetamodel.Builder<K,C,P>>
Builder for creating a
MapEntityChildMetamodel for the given parent class and child entity metamodel. The
builder can be used to configure the child entity metamodel and create a new instance of
MapEntityChildMetamodel. The ChildEntityFieldDefinition is required to resolve the child entities
from the parent entity and evolve the parent entity based on the child entities. The
commandTargetResolver and eventTargetMatcher are both
required, as they are used to match the child entities to the command and event respectively.-
Field Summary
Fields inherited from class org.axonframework.modelling.entity.child.AbstractEntityChildMetamodel.Builder
commandTargetResolver, eventTargetMatcher, metamodel -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newMapEntityChildMetamodelinstance with the configured properties.childEntityFieldDefinition(ChildEntityFieldDefinition<P, Map<K, C>> fieldDefinition) Sets theChildEntityFieldDefinitionto use for resolving the child entities from the parent entity and evolving the parent entity based on the evolved child entities.protected voidvalidate()Methods inherited from class org.axonframework.modelling.entity.child.AbstractEntityChildMetamodel.Builder
commandTargetResolver, eventTargetMatcher
-
Method Details
-
childEntityFieldDefinition
public MapEntityChildMetamodel.Builder<K,C, childEntityFieldDefinitionP> (ChildEntityFieldDefinition<P, Map<K, C>> fieldDefinition) Sets theChildEntityFieldDefinitionto use for resolving the child entities from the parent entity and evolving the parent entity based on the evolved child entities.- Parameters:
fieldDefinition- theChildEntityFieldDefinitionto use for resolving the child entities from the parent entity- Returns:
- this builder instance for a fluent API
-
build
Builds a newMapEntityChildMetamodelinstance with the configured properties. TheChildEntityFieldDefinition,EventTargetMatcher, andCommandTargetResolverare required to be set before calling this method.- Returns:
- a new
MapEntityChildMetamodelinstance with the configured properties
-
validate
protected void validate()- Overrides:
validatein classAbstractEntityChildMetamodel.Builder<C,P, MapEntityChildMetamodel.Builder<K, C, P>>
-