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 Details

    • of

      public static ParameterModel of(org.jboss.jandex.MethodParameterInfo parameter)
      Creates and returns a new ParameterModel instance based on the provided Jandex MethodParameterInfo.
      Parameters:
      parameter - The Jandex MethodParameterInfo representing the GraphQL method parameter.
      Returns:
      A new ParameterModel instance.
    • isValueParameter

      public boolean isValueParameter()
      Checks if the parameter is a value parameter, either a root or nested parameter.
      Returns:
      true if the parameter is a value parameter, otherwise false.
    • isRootParameter

      public boolean isRootParameter()
      Checks if the parameter is a root parameter (neither header nor nested parameter).
      Returns:
      true if the parameter is a root parameter, otherwise false.
    • isNestedParameter

      public boolean isNestedParameter()
      Checks if the parameter is a nested parameter.
      Returns:
      true if the parameter is a nested parameter, otherwise false.
    • 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: NamedElement
      Gets the name of the NamedElement, considering any Name annotation if present.
      Specified by:
      getName in interface NamedElement
      Returns:
      The field name.
    • getRawName

      public String getRawName()
      Description copied from interface: NamedElement
      Gets the raw (original) name of the NamedElement.
      Specified by:
      getRawName in interface NamedElement
      Returns:
      The raw field name.
    • getDirectiveLocation

      public String getDirectiveLocation()
      Description copied from interface: NamedElement
      Gets the location of directives associated with this NamedElement.
      Specified by:
      getDirectiveLocation in interface NamedElement
      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: NamedElement
      Checks if the NamedElement has associated directives.
      Specified by:
      hasDirectives in interface NamedElement
      Returns:
      true if the NamedElement has directives, otherwise false.
    • getDirectives

      public List<DirectiveInstance> getDirectives()
      Description copied from interface: NamedElement
      Gets the list of directives associated with the NamedElement.
      Specified by:
      getDirectives in interface NamedElement
      Returns:
      The list of DirectiveInstance objects.