Package org.mapstruct.ap.internal.model
Class SubclassMapping
- java.lang.Object
-
- org.mapstruct.ap.internal.writer.FreeMarkerWritable
-
- org.mapstruct.ap.internal.model.common.ModelElement
-
- org.mapstruct.ap.internal.model.SubclassMapping
-
- All Implemented Interfaces:
Writable
public class SubclassMapping extends ModelElement
Represents the mapping between a Subclass and its mapping target. This will be used by aBeanMappingMethodthat hasSubclassMappingannotations applied to it. Before doing the normal mapping for that method it will first check if the source object is of the sourceType if so it will use the assignment instead.- Author:
- Ben Zegveld
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.mapstruct.ap.internal.writer.Writable
Writable.Context
-
-
Constructor Summary
Constructors Constructor Description SubclassMapping(Type sourceType, String sourceArgument, Type targetType, Assignment assignment)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object other)AssignmentWrappergetAssignment()Set<Type>getImportTypes()Returns a set containing thoseTypes referenced by this model element for which an import statement needs to be declared.StringgetSourceArgument()TypegetSourceType()inthashCode()-
Methods inherited from class org.mapstruct.ap.internal.writer.FreeMarkerWritable
getTemplateName, getTemplateNameForClass, write
-
-
-
-
Constructor Detail
-
SubclassMapping
public SubclassMapping(Type sourceType, String sourceArgument, Type targetType, Assignment assignment)
-
-
Method Detail
-
getSourceType
public Type getSourceType()
-
getImportTypes
public Set<Type> getImportTypes()
Description copied from class:ModelElementReturns a set containing thoseTypes referenced by this model element for which an import statement needs to be declared.- Specified by:
getImportTypesin classModelElement- Returns:
- A set with type referenced by this model element. Must not be
null.
-
getAssignment
public AssignmentWrapper getAssignment()
-
getSourceArgument
public String getSourceArgument()
-
-