public class Field extends ModelElement
Writable.Context
Constructor and Description |
---|
Field(Type type,
String variableName) |
Field(Type type,
String variableName,
boolean used) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
static List<String> |
getFieldNames(Set<Field> fields) |
Set<Type> |
getImportTypes()
Returns a set containing those
Type s referenced by this model element for which an import statement needs
to be declared. |
Type |
getType()
Returns the type of this field.
|
String |
getVariableName()
Returns the variable name of this field.
|
int |
hashCode() |
boolean |
isTypeRequiresImport()
field needs to be imported
|
boolean |
isUsed()
indicates whether the field is indeed used
|
void |
setTypeRequiresImport(boolean typeRequiresImport)
set field needs to be imported
|
void |
setUsed(boolean isUsed)
sets the field as being used
|
getTemplateName, getTemplateNameForClass, write
public Type getType()
public String getVariableName()
public Set<Type> getImportTypes()
ModelElement
Type
s referenced by this model element for which an import statement needs
to be declared.getImportTypes
in class ModelElement
null
.public boolean isUsed()
public void setUsed(boolean isUsed)
isUsed
- must be true when being used.public boolean isTypeRequiresImport()
public void setTypeRequiresImport(boolean typeRequiresImport)
typeRequiresImport
- needs to be importedCopyright © 2012-2021 MapStruct Authors; All rights reserved. Released under the Apache Software License 2.0.