Package revxrsal.commands.command
Interface CommandCategory
- All Superinterfaces:
Comparable<CommandCategory>
,PermissionHolder
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 Summary
Modifier and TypeMethodDescription@NotNull @UnmodifiableView Map<CommandPath,
CommandCategory> Returns an unmodifiable view of all the sub-categories in this category.@NotNull CommandHandler
Returns the command handler that instantiated this category@NotNull @UnmodifiableView Map<CommandPath,
ExecutableCommand> Returns an unmodifiable view of all the commands in this category.@Nullable ExecutableCommand
Returns theExecutableCommand
of this category that is executed when no arguments are supplied for the category.@NotNull String
getName()
Returns the name of this category@Nullable CommandCategory
Returns the parent category of this category.@NotNull CommandPath
getPath()
Returns the full command path to this category@NotNull CommandPermission
Returns the required permission to access this category.boolean
isEmpty()
Returns whether is this command category empty or not.boolean
isSecret()
Returns whether is this category secret or not.Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface revxrsal.commands.command.trait.PermissionHolder
checkPermission, hasPermission
-
Method Details
-
getName
Returns the name of this category- Returns:
- The category name
-
getPath
Returns the full command path to this category- Returns:
- The command path
-
getCommandHandler
Returns the command handler that instantiated this category- Returns:
- The owning command handler
-
getParent
Returns the parent category of this category. This can be null in case of root categories.- Returns:
- The parent category
-
getDefaultAction
Returns theExecutableCommand
of this category that is executed when no arguments are supplied for the category.- Returns:
- The category's default action
- See Also:
-
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 interfacePermissionHolder
- 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
Returns an unmodifiable view of all the sub-categories in this category.- Returns:
- The sub-categories
-
getCommands
Returns an unmodifiable view of all the commands in this category.- Returns:
- The subcommands
-