Class AdminCommandRegistry
java.lang.Object
com.ordwen.odailyquests.api.commands.admin.AdminCommandRegistry
Registry for all admin subcommands in the plugin.
This class extends HashMap
, where each entry maps a subcommand name to its corresponding AdminCommandBase
handler.
It provides utility methods to register and retrieve admin commands.
Addons can use this registry to register their own administrative commands.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCommandHandler
(String name) Retrieves the command handler associated with the given name.Gets a map of all registered admin command handlers.Gets a set of all registered command names.void
registerCommand
(AdminCommandBase handler) Registers a new admin subcommand handler.
-
Constructor Details
-
AdminCommandRegistry
public AdminCommandRegistry()
-
-
Method Details
-
registerCommand
Registers a new admin subcommand handler.The handler is stored using its
AdminCommand.getName()
as the key.- Parameters:
handler
- the admin command handler to register
-
getCommandHandler
Retrieves the command handler associated with the given name.- Parameters:
name
- the name of the subcommand- Returns:
- the corresponding
AdminCommandBase
, ornull
if not found
-
getCommandHandlers
Gets a map of all registered admin command handlers.- Returns:
- a map of subcommand names to their handlers
-
getCommandNames
Gets a set of all registered command names.- Returns:
- a set of subcommand names
-