Class CommandBase<T>

java.lang.Object
redempt.ordinate.command.CommandBase<T>
Type Parameters:
T - The sender type
All Implemented Interfaces:
Named

public class CommandBase<T> extends Object implements Named
Represents an executable command which can be registered
  • Constructor Details

  • Method Details

    • getHelpPage

      public HelpPage<T> getHelpPage()
      Returns:
      The help page for this command
    • getCommands

      public List<Command<T>> getCommands()
      Returns:
      The individual commands which might be executed when this command is run
    • getName

      public String getName()
      Specified by:
      getName in interface Named
    • getNames

      public List<String> getNames()
      Returns:
      All aliases of this command
    • getCompletions

      public CompletionResult<T> getCompletions(T sender, String[] args)
      Calculate completions for a given input
      Parameters:
      sender - The sender of the command
      args - The arguments, including partials
      Returns:
      The completions
    • getCompletions

      public CompletionResult<T> getCompletions(T sender, String args)
      Calculate completions for a given input
      Parameters:
      sender - The sender of the command
      args - The arguments, including partials
      Returns:
      The completions
    • getCompletions

      public CompletionResult<T> getCompletions(T sender, SplittableList<Argument> args)
      Calculate completions for a given input
      Parameters:
      sender - The sender of the command
      args - The arguments, including partials
      Returns:
      The completions
    • execute

      public CommandResult<T> execute(T sender, String args)
      Execute a command
      Parameters:
      sender - The sender of the command
      args - The arguments
      Returns:
      The result of the command's execution
    • execute

      public CommandResult<T> execute(T sender, String[] args)
      Execute a command
      Parameters:
      sender - The sender of the command
      args - The arguments
      Returns:
      The result of the command's execution
    • execute

      public CommandResult<T> execute(T sender, SplittableList<Argument> args)
      Execute a command
      Parameters:
      sender - The sender of the command
      args - The arguments
      Returns:
      The result of the command's execution