Interface CommandManager<B,S>

All Known Implementing Classes:
AbstractCommandManager

public interface CommandManager<B,S>
  • Method Details

    • getBootstrap

      @NotNull B getBootstrap()
      The bootstrap for the platform on which the manager is being used on
      Returns:
      the bootstrap instance
    • exceptionHandler

      @NotNull @NotNull CommandExceptionHandler<S> exceptionHandler()
      The exception handler which handles exceptions during execution stage.
      Returns:
      the exception handler
    • executeCommand

      <C> void executeCommand(@NotNull @NotNull Command<S> command, @NotNull S sender, @NotNull @NotNull String[] args)
      Executes a command asynchronously OR synchronously using the execution coordinator CommandExecutionCoordinator<S>
      Type Parameters:
      C - the type of the custom sender
      Parameters:
      command - the command to execute
      sender - the command sender
      args - the arguments used
    • getSenderWrapper

      @NotNull @NotNull SenderWrapper<S> getSenderWrapper()
      The wrapper for sending messages across different platforms
      Returns:
      the sender wrapper
    • typeRegistry

      @NotNull @NotNull ArgumentTypeRegistry typeRegistry()
      The argument types registry which contains all types of arguments that will be handled during execution
      Returns:
      the argument type registry
    • commandPrefix

      char commandPrefix()
      The prefix of all commands
      Returns:
      the prefix
    • registerCommand

      <C extends Command<S>> void registerCommand(C command)
      Registers a command in the platform
      Type Parameters:
      C - the type of the command class
      Parameters:
      command - the command instance
    • unregisterCommand

      void unregisterCommand(String name)
      Unregisters the command
      Parameters:
      name - the command to unregister
    • getCommand

      @Nullable @Nullable Command<S> getCommand(String name)
      Gets a command which is already registered
      Parameters:
      name - the command's name to fetch
      Returns:
      the registered command that goes by a specific name returns null if no command with that name was registered !
    • getCommands

      @NotNull @NotNull Collection<Command<S>> getCommands()
      All registered commands
      Returns:
      all registered commands
    • flagRegistry

      @NotNull @NotNull FlagRegistry flagRegistry()
      The registry that holds all the flags that will be handled during command execution
      Returns:
      the flags registry
      See Also:
    • captionRegistry

      @NotNull @NotNull CaptionRegistry<S> captionRegistry()
      The registry that holds all the captions that will be used during command execution
      Returns:
      the ca registry
      See Also:
    • senderProviderRegistry

      @NotNull @NotNull SenderProviderRegistry<S> senderProviderRegistry()
      The registry that holds all custom sender providers that will be used during command execution
      Returns:
      the sender provider registry
      See Also:
    • helpProvider

      @Nullable @Nullable CommandHelpProvider<S> helpProvider()
      Fetches the command help provider during command execution of '/cmd help'
      Returns:
      the sender provider registry
      See Also:
    • setHelpProvider

      void setHelpProvider(@Nullable @Nullable CommandHelpProvider<S> helpProvider)
      Sets the help menu provider for all commands registered
      Parameters:
      helpProvider - the new help provider
    • findAmbiguity

      @NotNull @NotNull List<CommandSyntax<S>> findAmbiguity(@NotNull @NotNull Command<S> command)
      Finds syntaxes that are ambigious
      Parameters:
      command - the syntaxes provider to check upon for ambiguity
      Returns:
      the ambigious syntaxes
    • findSyntax

      io.github.mqzn.commands.base.syntax.tree.CommandTree.CommandSearchResult<S> findSyntax(@NotNull @NotNull Command<S> command, DelegateCommandContext<S> delegateContext)
      Finds the most suitable syntax for the context that is being executed
      Parameters:
      command - the command being executed
      delegateContext - the delegate command context (context containing only raws)
      Returns:
      the traversing result of the search
    • suggest

      @NotNull @NotNull List<String> suggest(Command<S> command, S sender, String[] args)
      Suggests the suggestions in correspond to the args being used while tab completing and to the command arguments of course !
      Parameters:
      command - the command being used while tab completing
      sender - the sender
      args - the args
      Returns:
      the suggestions
    • numericArgumentSuggestionProcessor

      @NotNull @NotNull ArgumentNumberSuggestionProcessor numericArgumentSuggestionProcessor()
      Numeric argument suggestion processor
      Returns:
      the processor of numeric args suggestions
    • suggestionProviderRegistry

      @NotNull @NotNull SuggestionProviderRegistry suggestionProviderRegistry()
      The suggestion provider registry
      Returns:
      the provider registry for suggestions per argument
      See Also:
    • log

      void log(String msg, Object... args)
    • handleHelpRequest

      default void handleHelpRequest(@NotNull S sender, @NotNull @NotNull Context<S> context, @NotNull @NotNull String label, int page, @NotNull @NotNull List<? extends CommandSyntax<S>> syntaxes) throws IllegalArgumentException
      Throws:
      IllegalArgumentException