Interface CommandRegistrar<S extends Source>

All Known Subinterfaces:
Imperat<S>
All Known Implementing Classes:
BaseImperat

public sealed interface CommandRegistrar<S extends Source> permits Imperat<S>
  • Method Details

    • registerCommand

      void registerCommand(Command<S> command)
      Registers a command into the dispatcher
      Parameters:
      command - the command to register
    • registerCommands

      default void registerCommands(Command<S>... commands)
      Registers some commands into the dispatcher
      Parameters:
      commands - the commands to register
    • registerCommand

      void registerCommand(Class<?> command)
      Registers a command class built by the annotations using a parser
      Parameters:
      command - the annotated command instance to parse
    • registerCommands

      default void registerCommands(Class<?>... commands)
      Registers some commands into the dispatcher annotations using a parser
      Parameters:
      commands - the commands to register
    • registerCommand

      void registerCommand(Object commandInstance)
      Registers a command instance built by the annotations using a parser
      Parameters:
      commandInstance - the annotated command instance to parse
    • registerCommands

      default void registerCommands(Object... commandInstances)
      Registers some command instances built by the annotations using a parser
      Parameters:
      commandInstances - the annotated command instances to parse
    • unregisterCommand

      void unregisterCommand(String name)
      Unregisters a command from the internal registry
      Parameters:
      name - the name of the command to unregister
    • unregisterAllCommands

      void unregisterAllCommands()
      Unregisters all commands from the internal registry
    • getCommand

      @Nullable @Nullable Command<S> getCommand(String name)
      Parameters:
      name - the name/alias of the command
      Returns:
      fetches Command with specific name
    • getCommand

      @Nullable default @Nullable Command<S> getCommand(CommandParameter<S> parameter)
      Parameters:
      parameter - the parameter
      Returns:
      the command from the parameter's name
    • getSubCommand

      @Nullable @Nullable Command<S> getSubCommand(String owningCommand, String name)
      Parameters:
      owningCommand - the command owning this sub-command
      name - the name of the subcommand you're looking for
      Returns:
      the subcommand of a command
    • getRegisteredCommands

      Collection<? extends Command<S>> getRegisteredCommands()
      Gets all registered commands
      Returns:
      the registered commands