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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.mapstruct.ap.internal.writer.Writable
Writable.Context
-
-
Field Summary
Fields Modifier and Type Field Description private Assignmentassignmentprivate java.lang.StringsourceArgumentprivate TypesourceTypeprivate TypetargetType
-
Constructor Summary
Constructors Constructor Description SubclassMapping(Type sourceType, java.lang.String sourceArgument, Type targetType, Assignment assignment)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)AssignmentWrappergetAssignment()java.util.Set<Type>getImportTypes()Returns a set containing thoseTypes referenced by this model element for which an import statement needs to be declared.java.lang.StringgetSourceArgument()TypegetSourceType()inthashCode()-
Methods inherited from class org.mapstruct.ap.internal.writer.FreeMarkerWritable
getTemplateName, getTemplateNameForClass, write
-
-
-
-
Field Detail
-
sourceType
private final Type sourceType
-
targetType
private final Type targetType
-
assignment
private final Assignment assignment
-
sourceArgument
private final java.lang.String sourceArgument
-
-
Constructor Detail
-
SubclassMapping
public SubclassMapping(Type sourceType, java.lang.String sourceArgument, Type targetType, Assignment assignment)
-
-
Method Detail
-
getSourceType
public Type getSourceType()
-
getImportTypes
public java.util.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 java.lang.String getSourceArgument()
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-