Interface CommandCategory

All Superinterfaces:
Comparable<CommandCategory>, PermissionHolder

public interface CommandCategory extends PermissionHolder, Comparable<CommandCategory>
Represents a command category.

Command categories do not have explicit actions by themselves, however they can include the following:

  • Subcommands, which are executable commands that perform specific actions
  • Subactions, such as Default.
  • Method Details

    • getName

      @NotNull @NotNull String getName()
      Returns the name of this category
      Returns:
      The category name
    • getPath

      @NotNull @NotNull CommandPath getPath()
      Returns the full command path to this category
      Returns:
      The command path
    • getCommandHandler

      @NotNull @NotNull CommandHandler getCommandHandler()
      Returns the command handler that instantiated this category
      Returns:
      The owning command handler
    • getParent

      @Nullable @Nullable CommandCategory getParent()
      Returns the parent category of this category. This can be null in case of root categories.
      Returns:
      The parent category
    • getDefaultAction

      @Nullable @Nullable ExecutableCommand getDefaultAction()
      Returns the ExecutableCommand of this category that is executed when no arguments are supplied for the category.
      Returns:
      The category's default action
      See Also:
    • getPermission

      @NotNull @NotNull CommandPermission getPermission()
      Returns the required permission to access this category.

      Command categories by default do not have explicit permissions, therefore having access to the category is having access to any of its children commands or categories.

      Specified by:
      getPermission in interface PermissionHolder
      Returns:
      The command permission
    • isSecret

      boolean isSecret()
      Returns whether is this category secret or not. This will only return true if all the children categories and commands of this category are secret.
      Returns:
      Is this category secret or not.
    • isEmpty

      boolean isEmpty()
      Returns whether is this command category empty or not.

      A command category is empty if it has no sub-commands, no sub-categories, and no default action.

      Returns:
      Is this category empty or not
    • getCategories

      @NotNull @NotNull @UnmodifiableView Map<CommandPath,CommandCategory> getCategories()
      Returns an unmodifiable view of all the sub-categories in this category.
      Returns:
      The sub-categories
    • getCommands

      @NotNull @NotNull @UnmodifiableView Map<CommandPath,ExecutableCommand> getCommands()
      Returns an unmodifiable view of all the commands in this category.
      Returns:
      The subcommands