Package net.okocraft.box.api.command
Class SubCommandHoldable.SubCommandHolder
java.lang.Object
net.okocraft.box.api.command.SubCommandHoldable.SubCommandHolder
- Enclosing interface:
SubCommandHoldable
A class that holds subcommands.
-
Constructor Summary
ConstructorDescriptionSubCommandHolder
(@NotNull Command... subCommands) The constructor ofSubCommandHoldable.SubCommandHolder
. -
Method Summary
Modifier and TypeMethodDescriptionGets the set of subcommands.void
Registers the new subcommand.Searches for a command that matches the name or aliases.void
unregister
(@NotNull Command subCommand) Unregisters the subcommand.
-
Constructor Details
-
SubCommandHolder
The constructor ofSubCommandHoldable.SubCommandHolder
.- Parameters:
subCommands
- the set of subcommands
-
-
Method Details
-
getSubCommands
Gets the set of subcommands.The returned list can be changed in implementation, but it should not add or remove.
- Returns:
- the list of subcommands
-
register
Registers the new subcommand.- Parameters:
subCommand
- the new subcommand
-
unregister
Unregisters the subcommand.- Parameters:
subCommand
- the subcommand to unregister
-
search
Searches for a command that matches the name or aliases.- Parameters:
name
- the name or the alias of the command- Returns:
- the search result
-