Package org.mapstruct.ap.internal.model
Class CollectionAssignmentBuilder
java.lang.Object
org.mapstruct.ap.internal.model.CollectionAssignmentBuilder
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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionassignment(Assignment assignment) build()nullValueCheckStrategy(org.mapstruct.ap.internal.gem.NullValueCheckStrategyGem nvcs) nullValuePropertyMappingStrategy(org.mapstruct.ap.internal.gem.NullValuePropertyMappingStrategyGem nvpms) rightHandSide(SourceRHS sourceRHS) targetAccessorType(AccessorType targetAccessorType) targetPropertyName(String targetPropertyName) targetReadAccessor(Accessor targetReadAccessor) targetType(Type targetType)
-
Constructor Details
-
CollectionAssignmentBuilder
public CollectionAssignmentBuilder()
-
-
Method Details
-
mappingBuilderContext
-
method
-
targetReadAccessor
-
targetType
-
targetPropertyName
-
targetAccessorType
-
assignment
- Parameters:
assignment- the assignment that needs to be invoked- Returns:
- this builder for chaining
-
rightHandSide
- 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
-