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 aBeanMappingMethod
that hasSubclassMapping
annotations 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 boolean
equals(Object other)
AssignmentWrapper
getAssignment()
Set<Type>
getImportTypes()
Returns a set containing thoseType
s referenced by this model element for which an import statement needs to be declared.String
getSourceArgument()
Type
getSourceType()
int
hashCode()
-
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: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 classModelElement
- Returns:
- A set with type referenced by this model element. Must not be
null
.
-
getAssignment
public AssignmentWrapper getAssignment()
-
getSourceArgument
public String getSourceArgument()
-
-