java.lang.Object
io.github.projectunified.craftcommand.processor.model.ParameterModel

public class ParameterModel extends Object
Model representing a command method parameter.
  • Constructor Details

    • ParameterModel

      public ParameterModel(String name, TypeMirror type, boolean greedy, boolean optional, String defaultValue, String suggestProvider, VariableElement element)
      Constructs a ParameterModel.
      Parameters:
      name - the parameter name (from @Name or reflection)
      type - the Java type of the parameter
      greedy - true if marked with @Greedy
      optional - true if marked with @Optional
      defaultValue - the default value string when optional, or null
      suggestProvider - the custom suggest provider method name, or null
      element - the underlying VariableElement
  • Method Details

    • getName

      public String getName()
      Gets the parameter name.
      Returns:
      the parameter name
    • getType

      public TypeMirror getType()
      Gets the Java TypeMirror of this parameter.
      Returns:
      the parameter type
    • isGreedy

      public boolean isGreedy()
      Checks if this parameter is greedy.
      Returns:
      true if greedy
    • isOptional

      public boolean isOptional()
      Checks if this parameter is optional.
      Returns:
      true if optional
    • getDefaultValue

      public String getDefaultValue()
      Gets the default value string.
      Returns:
      the default value, or null
    • getSuggestProvider

      public String getSuggestProvider()
      Gets the custom suggestion provider method name.
      Returns:
      the suggestion provider name, or null
    • getElement

      public VariableElement getElement()
      Gets the underlying VariableElement.
      Returns:
      the variable element