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
SetterWrapperForCollectionsAndMapsWithNullCheck
is used when a direct assignment is done or theNullValueCheckStrategy
isNullValueCheckStrategy.ALWAYS
. It is also done inExistingInstanceSetterWrapperForCollectionsAndMaps
which 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 CollectionAssignmentBuilder
assignment(Assignment assignment)
Assignment
build()
CollectionAssignmentBuilder
mappingBuilderContext(MappingBuilderContext ctx)
CollectionAssignmentBuilder
method(Method method)
CollectionAssignmentBuilder
nullValueCheckStrategy(org.mapstruct.ap.internal.gem.NullValueCheckStrategyGem nvcs)
CollectionAssignmentBuilder
nullValuePropertyMappingStrategy(org.mapstruct.ap.internal.gem.NullValuePropertyMappingStrategyGem nvpms)
CollectionAssignmentBuilder
rightHandSide(SourceRHS sourceRHS)
CollectionAssignmentBuilder
targetAccessorType(AccessorType targetAccessorType)
CollectionAssignmentBuilder
targetPropertyName(String targetPropertyName)
CollectionAssignmentBuilder
targetReadAccessor(Accessor targetReadAccessor)
CollectionAssignmentBuilder
targetType(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()
-
-