Class ParameterModel
- java.lang.Object
-
- io.smallrye.graphql.client.model.helper.ParameterModel
-
- All Implemented Interfaces:
NamedElement
public class ParameterModel extends Object implements NamedElement
Represents a model for a method parameter in GraphQL, providing information about the parameter's name, type, and associated directives.- Author:
- mskacelik
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetDirectiveLocation()Gets the location of directives associated with this NamedElement.List<DirectiveInstance>getDirectives()Gets the list of directives associated with the NamedElement.StringgetName()Gets the name of the NamedElement, considering anyNameannotation if present.Stream<String>getNestedParameterNames()Gets the names of nested parameters if the parameter is a nested parameter.StringgetRawName()Gets the raw (original) name of the NamedElement.StringgraphQlInputTypeName()Gets the GraphQL input type name for the parameter.booleanhasDirectives()Checks if the NamedElement has associated directives.booleanisNestedParameter()Checks if the parameter is a nested parameter.booleanisRootParameter()Checks if the parameter is a root parameter (neither header nor nested parameter).booleanisValueParameter()Checks if the parameter is a value parameter, either a root or nested parameter.static ParameterModelof(org.jboss.jandex.MethodParameterInfo parameter)Creates and returns a newParameterModelinstance based on the provided JandexMethodParameterInfo.
-
-
-
Method Detail
-
of
public static ParameterModel of(org.jboss.jandex.MethodParameterInfo parameter)
Creates and returns a newParameterModelinstance based on the provided JandexMethodParameterInfo.- Parameters:
parameter- The JandexMethodParameterInforepresenting the GraphQL method parameter.- Returns:
- A new
ParameterModelinstance.
-
isValueParameter
public boolean isValueParameter()
Checks if the parameter is a value parameter, either a root or nested parameter.- Returns:
trueif the parameter is a value parameter, otherwisefalse.
-
isRootParameter
public boolean isRootParameter()
Checks if the parameter is a root parameter (neither header nor nested parameter).- Returns:
trueif the parameter is a root parameter, otherwisefalse.
-
isNestedParameter
public boolean isNestedParameter()
Checks if the parameter is a nested parameter.- Returns:
trueif the parameter is a nested parameter, otherwisefalse.
-
getNestedParameterNames
public Stream<String> getNestedParameterNames()
Gets the names of nested parameters if the parameter is a nested parameter.- Returns:
- A stream of nested parameter names.
-
getName
public String getName()
Description copied from interface:NamedElementGets the name of the NamedElement, considering anyNameannotation if present.- Specified by:
getNamein interfaceNamedElement- Returns:
- The field name.
-
getRawName
public String getRawName()
Description copied from interface:NamedElementGets the raw (original) name of the NamedElement.- Specified by:
getRawNamein interfaceNamedElement- Returns:
- The raw field name.
-
getDirectiveLocation
public String getDirectiveLocation()
Description copied from interface:NamedElementGets the location of directives associated with this NamedElement.- Specified by:
getDirectiveLocationin interfaceNamedElement- Returns:
- The directive location
-
graphQlInputTypeName
public String graphQlInputTypeName()
Gets the GraphQL input type name for the parameter.- Returns:
- The GraphQL input type name.
-
hasDirectives
public boolean hasDirectives()
Description copied from interface:NamedElementChecks if the NamedElement has associated directives.- Specified by:
hasDirectivesin interfaceNamedElement- Returns:
trueif the NamedElement has directives, otherwisefalse.
-
getDirectives
public List<DirectiveInstance> getDirectives()
Description copied from interface:NamedElementGets the list of directives associated with the NamedElement.- Specified by:
getDirectivesin interfaceNamedElement- Returns:
- The list of
DirectiveInstanceobjects.
-
-