Class AdminCommandRegistry

java.lang.Object
com.ordwen.odailyquests.api.commands.admin.AdminCommandRegistry

public class AdminCommandRegistry extends Object
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 Details

    • AdminCommandRegistry

      public AdminCommandRegistry()
  • Method Details

    • registerCommand

      public void registerCommand(AdminCommandBase handler)
      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

      public AdminCommandBase getCommandHandler(String name)
      Retrieves the command handler associated with the given name.
      Parameters:
      name - the name of the subcommand
      Returns:
      the corresponding AdminCommandBase, or null if not found
    • getCommandHandlers

      public Collection<AdminCommandBase> getCommandHandlers()
      Gets a map of all registered admin command handlers.
      Returns:
      a map of subcommand names to their handlers
    • getCommandNames

      public Set<String> getCommandNames()
      Gets a set of all registered command names.
      Returns:
      a set of subcommand names