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

public class MethodModel extends Object
Model representing a command or subcommand method.
  • Constructor Details

    • MethodModel

      public MethodModel(String methodName, String subcommandName, List<String> aliases, ParameterModel senderParameter, List<ParameterModel> parameters, boolean isDefault, ExecutableElement element)
      Constructs a MethodModel.
      Parameters:
      methodName - the name of the Java method
      subcommandName - the name of the subcommand, or null if default action
      aliases - the subcommand aliases
      senderParameter - the model for the first (sender) parameter
      parameters - the models for the remaining command arguments
      isDefault - true if marked with @Default
      element - the underlying ExecutableElement
  • Method Details

    • getMethodName

      public String getMethodName()
      Gets the Java method name.
      Returns:
      the method name
    • getSubcommandName

      public String getSubcommandName()
      Gets the subcommand name.
      Returns:
      the subcommand name, or null
    • getAliases

      public List<String> getAliases()
      Gets the subcommand aliases.
      Returns:
      the list of aliases
    • getSenderType

      public TypeMirror getSenderType()
      Gets the type of the sender parameter.
      Returns:
      the sender type mirror
    • getSenderParameter

      public ParameterModel getSenderParameter()
      Gets the sender parameter model.
      Returns:
      the sender parameter model
    • getParameters

      public List<ParameterModel> getParameters()
      Gets the list of argument parameters.
      Returns:
      the list of parameter models
    • isDefault

      public boolean isDefault()
      Checks if this method is the default action.
      Returns:
      true if default action
    • getElement

      public ExecutableElement getElement()
      Gets the underlying Java ExecutableElement.
      Returns:
      the executable element