Class FieldModel
java.lang.Object
io.smallrye.graphql.client.model.helper.FieldModel
- All Implemented Interfaces:
NamedElement
Represents a model for a Java (jandex) class field, providing information about the field's characteristics
and associated directives.
- Author:
- mskacelik
-
Method Summary
Modifier and TypeMethodDescriptiongetAlias()If the field is renamed with aNameannotation, the real field name is used as an alias.Gets the location of directives associated with this NamedElement.Gets the list of directive instances associated with the field.getName()Gets the name of the NamedElement, considering anyNameannotation if present.Gets the raw (original) name of the NamedElement.getType()Gets the type model associated with the field.booleanhasAnnotation(org.jboss.jandex.DotName annotation) Checks if the field has a specific annotation.booleanChecks if the field has any associated directives.booleanisStatic()Checks if the field is static.booleanChecks if the field is synthetic.booleanChecks if the field is transient.static FieldModelof(org.jboss.jandex.FieldInfo field) Creates and returns a newFieldModelinstance based on the provided field information and raw type.
-
Method Details
-
of
Creates and returns a newFieldModelinstance based on the provided field information and raw type.- Parameters:
field- TheFieldInfoobject representing the field.- Returns:
- A new
FieldModelinstance.
-
getAlias
If the field is renamed with aNameannotation, the real field name is used as an alias.- Returns:
- An
Optionalcontaining the alias if explicitly stated, otherwise empty.
-
getName
Description copied from interface:NamedElementGets the name of the NamedElement, considering anyNameannotation if present.- Specified by:
getNamein interfaceNamedElement- Returns:
- The field name.
-
getRawName
Description copied from interface:NamedElementGets the raw (original) name of the NamedElement.- Specified by:
getRawNamein interfaceNamedElement- Returns:
- The raw field name.
-
getDirectiveLocation
Description copied from interface:NamedElementGets the location of directives associated with this NamedElement.- Specified by:
getDirectiveLocationin interfaceNamedElement- Returns:
- The directive location
-
hasAnnotation
public boolean hasAnnotation(org.jboss.jandex.DotName annotation) Checks if the field has a specific annotation.- Parameters:
annotation- The annotation to check.- Returns:
trueif the field has the specified annotation, otherwisefalse.
-
isStatic
public boolean isStatic()Checks if the field is static.- Returns:
trueif the field is static, otherwisefalse.
-
isTransient
public boolean isTransient()Checks if the field is transient.- Returns:
trueif the field is transient, otherwisefalse.
-
isSynthetic
public boolean isSynthetic()Checks if the field is synthetic.- Returns:
trueif the field is synthetic, otherwisefalse.
-
getType
Gets the type model associated with the field.- Returns:
- The
TypeModelrepresenting the type of the field.
-
hasDirectives
public boolean hasDirectives()Checks if the field has any associated directives.- Specified by:
hasDirectivesin interfaceNamedElement- Returns:
trueif the field has directives, otherwisefalse.
-
getDirectives
Gets the list of directive instances associated with the field.- Specified by:
getDirectivesin interfaceNamedElement- Returns:
- The list of
DirectiveInstanceobjects.
-