Package org.mapstruct.ap.internal.model
Class IterableCreation
- java.lang.Object
-
- org.mapstruct.ap.internal.writer.FreeMarkerWritable
-
- org.mapstruct.ap.internal.model.common.ModelElement
-
- org.mapstruct.ap.internal.model.IterableCreation
-
- All Implemented Interfaces:
Writable
public class IterableCreation extends ModelElement
Model element that can be used to create a type ofIterableorMap. If an implementation type is used and the target type has a constructor withintas parameter and the source parameter is ofCollection,MaporArraytype then MapStruct will use that constructor with thesize/lengthfrom the source parameter.
-
-
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 booleancanUseSizeprivate MethodReferencefactoryMethodprivate booleanloadFactorAdjustmentprivate TyperesultTypeprivate ParametersourceParameter
-
Constructor Summary
Constructors Modifier Constructor Description privateIterableCreation(Type resultType, Parameter sourceParameter, MethodReference factoryMethod)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IterableCreationcreate(NormalTypeMappingMethod mappingMethod, Parameter sourceParameter)TypegetEnumSetElementType()MethodReferencegetFactoryMethod()java.util.Set<Type>getImportTypes()Returns a set containing thoseTypes referenced by this model element for which an import statement needs to be declared.TypegetResultType()ParametergetSourceParameter()booleanisCanUseSize()booleanisEnumSet()booleanisLoadFactorAdjustment()-
Methods inherited from class org.mapstruct.ap.internal.writer.FreeMarkerWritable
getTemplateName, getTemplateNameForClass, write
-
-
-
-
Field Detail
-
resultType
private final Type resultType
-
sourceParameter
private final Parameter sourceParameter
-
factoryMethod
private final MethodReference factoryMethod
-
canUseSize
private final boolean canUseSize
-
loadFactorAdjustment
private final boolean loadFactorAdjustment
-
-
Constructor Detail
-
IterableCreation
private IterableCreation(Type resultType, Parameter sourceParameter, MethodReference factoryMethod)
-
-
Method Detail
-
create
public static IterableCreation create(NormalTypeMappingMethod mappingMethod, Parameter sourceParameter)
-
getResultType
public Type getResultType()
-
getSourceParameter
public Parameter getSourceParameter()
-
getFactoryMethod
public MethodReference getFactoryMethod()
-
isCanUseSize
public boolean isCanUseSize()
-
isLoadFactorAdjustment
public boolean isLoadFactorAdjustment()
-
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.
-
getEnumSetElementType
public Type getEnumSetElementType()
-
isEnumSet
public boolean isEnumSet()
-
-