Package org.mapstruct.ap.internal.model
Class CollectionAssignmentBuilder
- java.lang.Object
-
- org.mapstruct.ap.internal.model.CollectionAssignmentBuilder
-
public class CollectionAssignmentBuilder extends Object
A builder that is used for creating an assignment to a collection. The created assignments to the following null checks:- source-null-check - For this the
SetterWrapperForCollectionsAndMapsWithNullCheckis used when a direct assignment is done or theNullValueCheckStrategyisNullValueCheckStrategy.ALWAYS. It is also done inExistingInstanceSetterWrapperForCollectionsAndMapswhich extendsSetterWrapperForCollectionsAndMapsWithNullCheck - target-null-check - Done in the
ExistingInstanceSetterWrapperForCollectionsAndMaps - local-var-null-check - Done in
ExistingInstanceSetterWrapperForCollectionsAndMaps, andSetterWrapperForCollectionsAndMapsWithNullCheck
- Presence check with direct assignment - We need a null check before setting, because we use the copy constructor
- Presence check for existing instance mapping - We need the null check because we call addAll / putAll.
- No Presence check and direct assignment - We use the copy constructor
- No Presence check and
NullValueCheckStrategy.ALWAYS- the user requested one
- Author:
- Filip Hrisafov
- source-null-check - For this the
-
-
Constructor Summary
Constructors Constructor Description CollectionAssignmentBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CollectionAssignmentBuilderassignment(Assignment assignment)Assignmentbuild()CollectionAssignmentBuildermappingBuilderContext(MappingBuilderContext ctx)CollectionAssignmentBuildermethod(Method method)CollectionAssignmentBuildernullValueCheckStrategy(org.mapstruct.ap.internal.gem.NullValueCheckStrategyGem nvcs)CollectionAssignmentBuildernullValuePropertyMappingStrategy(org.mapstruct.ap.internal.gem.NullValuePropertyMappingStrategyGem nvpms)CollectionAssignmentBuilderrightHandSide(SourceRHS sourceRHS)CollectionAssignmentBuildertargetAccessorType(AccessorType targetAccessorType)CollectionAssignmentBuildertargetPropertyName(String targetPropertyName)CollectionAssignmentBuildertargetReadAccessor(Accessor targetReadAccessor)CollectionAssignmentBuildertargetType(Type targetType)
-
-
-
Method Detail
-
mappingBuilderContext
public CollectionAssignmentBuilder mappingBuilderContext(MappingBuilderContext ctx)
-
method
public CollectionAssignmentBuilder method(Method method)
-
targetReadAccessor
public CollectionAssignmentBuilder targetReadAccessor(Accessor targetReadAccessor)
-
targetType
public CollectionAssignmentBuilder targetType(Type targetType)
-
targetPropertyName
public CollectionAssignmentBuilder targetPropertyName(String targetPropertyName)
-
targetAccessorType
public CollectionAssignmentBuilder targetAccessorType(AccessorType targetAccessorType)
-
assignment
public CollectionAssignmentBuilder assignment(Assignment assignment)
- Parameters:
assignment- the assignment that needs to be invoked- Returns:
- this builder for chaining
-
rightHandSide
public CollectionAssignmentBuilder rightHandSide(SourceRHS sourceRHS)
- Parameters:
sourceRHS- the source right hand side for getting the property for mapping- Returns:
- this builder for chaining
-
nullValueCheckStrategy
public CollectionAssignmentBuilder nullValueCheckStrategy(org.mapstruct.ap.internal.gem.NullValueCheckStrategyGem nvcs)
-
nullValuePropertyMappingStrategy
public CollectionAssignmentBuilder nullValuePropertyMappingStrategy(org.mapstruct.ap.internal.gem.NullValuePropertyMappingStrategyGem nvpms)
-
build
public Assignment build()
-
-