Class SetterWrapperForCollectionsAndMapsWithNullCheck
- java.lang.Object
-
- org.mapstruct.ap.internal.writer.FreeMarkerWritable
-
- org.mapstruct.ap.internal.model.common.ModelElement
-
- org.mapstruct.ap.internal.model.assignment.AssignmentWrapper
-
- org.mapstruct.ap.internal.model.assignment.WrapperForCollectionsAndMaps
-
- org.mapstruct.ap.internal.model.assignment.SetterWrapperForCollectionsAndMapsWithNullCheck
-
- All Implemented Interfaces:
Assignment
,Writable
- Direct Known Subclasses:
ExistingInstanceSetterWrapperForCollectionsAndMaps
,NewInstanceSetterWrapperForCollectionsAndMaps
public class SetterWrapperForCollectionsAndMapsWithNullCheck extends WrapperForCollectionsAndMaps
This wrapper handles the situation where an assignment is done via the setter and a null check is needed. This is needed when a direct assignment is used, or if the user has chosen the appropriate strategy- Author:
- Sjaak Derksen
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.mapstruct.ap.internal.model.common.Assignment
Assignment.AssignmentType
-
Nested classes/interfaces inherited from interface org.mapstruct.ap.internal.writer.Writable
Writable.Context
-
-
Field Summary
-
Fields inherited from class org.mapstruct.ap.internal.model.assignment.AssignmentWrapper
fieldAssignment
-
-
Constructor Summary
Constructors Constructor Description SetterWrapperForCollectionsAndMapsWithNullCheck(Assignment decoratedAssignment, List<Type> thrownTypesToExclude, Type targetType, TypeFactory typeFactory, boolean fieldAssignment)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<Type>
getImportTypes()
Returns a set containing thoseType
s referenced by this model element for which an import statement needs to be declared.boolean
isDirectAssignment()
boolean
isEnumSet()
-
Methods inherited from class org.mapstruct.ap.internal.model.assignment.WrapperForCollectionsAndMaps
getNullCheckLocalVarName, getNullCheckLocalVarType, getThrownTypes
-
Methods inherited from class org.mapstruct.ap.internal.model.assignment.AssignmentWrapper
createUniqueVarName, getAssignment, getSourceLocalVarName, getSourceLoopVarName, getSourceParameterName, getSourcePresenceCheckerReference, getSourceReference, getSourceType, getType, isCallingUpdateMethod, isFieldAssignment, isSourceReferenceParameter, setAssignment, setSourceLocalVarName, setSourceLoopVarName
-
Methods inherited from class org.mapstruct.ap.internal.writer.FreeMarkerWritable
getTemplateName, getTemplateNameForClass, write
-
-
-
-
Constructor Detail
-
SetterWrapperForCollectionsAndMapsWithNullCheck
public SetterWrapperForCollectionsAndMapsWithNullCheck(Assignment decoratedAssignment, List<Type> thrownTypesToExclude, Type targetType, TypeFactory typeFactory, boolean fieldAssignment)
-
-
Method Detail
-
getImportTypes
public Set<Type> getImportTypes()
Description copied from class:ModelElement
Returns a set containing thoseType
s referenced by this model element for which an import statement needs to be declared.- Specified by:
getImportTypes
in interfaceAssignment
- Overrides:
getImportTypes
in classAssignmentWrapper
- Returns:
- A set with type referenced by this model element. Must not be
null
.
-
isDirectAssignment
public boolean isDirectAssignment()
-
isEnumSet
public boolean isEnumSet()
-
-