Interface ExecutableCommand

All Superinterfaces:
CommandAnnotationHolder, Comparable<ExecutableCommand>, PermissionHolder

public interface ExecutableCommand extends CommandAnnotationHolder, PermissionHolder, Comparable<ExecutableCommand>
Represents a command which can be executed with specific arguments, flags or switches.
  • Method Details

    • getName

      @NotNull @NotNull String getName()
      Returns the name of the command
      Returns:
      The command name
    • getId

      @org.jetbrains.annotations.Range(from=0L, to=9223372036854775807L) int getId()
      Returns a unique ID of this command. Note that this ID will be shared by commands that are defined together in the same method through aliases.

      For example:

       @Command({"foo", "bar"})
       public void foo(CommandActor actor) {
           actor.reply("Way to go!");
       }
       

      The above code will result in 2 separate ExecutableCommands: foo and bar. Because foo and bar are defined in the same scope and behave exactly the same, they will share the same ID. This will also make sure that if an actor is on cooldown on foo, they will also be on cooldown on bar.

      Returns:
      The unique ID.
    • getUsage

      @NotNull @NotNull String getUsage()
      Returns the command usage. This can be explicitly defined by annotating the method with Usage, otherwise will be auto-generated by marking required parameters with angled brackets, and optional ones with squared brackets.
      Returns:
      The command usage.
    • getDescription

      @Nullable @Nullable String getDescription()
      Returns the command's description. This can be explicitly defined with Description, otherwise will return null.
      Returns:
      The command description
    • getPath

      @NotNull @NotNull CommandPath getPath()
      Returns the full path of the command
      Returns:
      The full command path
    • getParent

      @Nullable @Nullable CommandCategory getParent()
      Returns the parent category of this command. Can be null in case of root commands.
      Returns:
      The parent category of this command.
    • getParameters

      @NotNull @NotNull @Unmodifiable List<CommandParameter> getParameters()
      Returns all the parameters of this command
      Returns:
      The command parameters
    • getValueParameters

      @NotNull @NotNull @Unmodifiable Map<Integer,CommandParameter> getValueParameters()
      Returns all the parameters of this command that are resolveable from command arguments (i.e. not context)
      Returns:
      The command parameters
    • getCommandHandler

      @NotNull @NotNull CommandHandler getCommandHandler()
      Returns the command handler of this command
      Returns:
      The command handler
    • getResponseHandler

      @NotNull <T> @NotNull ResponseHandler<T> getResponseHandler()
      Returns the response handler of this command.
      Type Parameters:
      T - The return type
      Returns:
      The command's response handler
    • isSecret

      boolean isSecret()
      Returns whether is this command marked as secret or not

      Specified by SecretCommand.

      Returns:
      is secret or not.