Interface Command<S>


public sealed interface Command<S>
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
    An internal builder class for the command class Command<S>
  • Method Summary

    Modifier and Type
    Method
    Description
    static <P, S> Command.Builder<S>
    builder(CommandManager<P,S> manager, String name)
    Creating a builder instance for proper building of the command instance
    @NotNull io.github.mqzn.commands.base.cooldown.CommandCooldown
    Represents a command cooldown
    void
    defaultExecution(S sender, Context<S> commandContext)
    The default command execution when no args are provided !
    getSubCommand(@Nullable String name)
    Fetches a subcommand from the name
    default boolean
     
    @NotNull CommandInfo
    The info of the command, like description, permission, and it's aliases
    Command Manager instance that will be used in creation of this command
    The name of the command
    The requirements for the command to be executed
    Fetches the engine controlling and caching all suggestions for this command in a complex mapping
    @NotNull List<CommandSyntax<S>>
    The syntaxes registered for this command
    @NotNull io.github.mqzn.commands.base.syntax.tree.CommandTree<S>
    The tree of subcommands of this command specifically
  • Method Details

    • builder

      static <P, S> Command.Builder<S> builder(CommandManager<P,S> manager, String name)
      Creating a builder instance for proper building of the command instance
      Type Parameters:
      P - the bootstrap
      S - the sender
      Parameters:
      manager - the command manager for instantiating the command since every command is linked to it's manager
      name - the command name to start off by using it
      Returns:
      the builder instance created
      See Also:
    • manager

      CommandManager<?,S> manager()
      Command Manager instance that will be used in creation of this command
      Returns:
      the manager shared instance
    • name

      String name()
      The name of the command
      Returns:
      the command name
    • info

      @NotNull @NotNull CommandInfo info()
      The info of the command, like description, permission, and it's aliases
      Returns:
      the information of the command
    • cooldown

      @NotNull @NotNull io.github.mqzn.commands.base.cooldown.CommandCooldown cooldown()
      Represents a command cooldown
      Returns:
      the cooldown of the command
    • requirements

      @NotNull @NotNull Set<CommandRequirement<S>> requirements()
      The requirements for the command to be executed
      Returns:
      The requirements for the command to be executed
    • defaultExecution

      void defaultExecution(S sender, Context<S> commandContext)
      The default command execution when no args are provided !
      Parameters:
      sender - the command executor !
    • syntaxes

      @NotNull @NotNull List<CommandSyntax<S>> syntaxes()
      The syntaxes registered for this command
      Returns:
      The syntaxes registered for this command
      See Also:
    • tree

      @NotNull @NotNull io.github.mqzn.commands.base.syntax.tree.CommandTree<S> tree()
      The tree of subcommands of this command specifically
      Returns:
      the tree of all subcommands hierarchy
    • suggestions

      @NotNull @NotNull CommandSuggestionEngine<S> suggestions()
      Fetches the engine controlling and caching all suggestions for this command in a complex mapping
      Returns:
      the command suggestions holder
    • hasCooldown

      default boolean hasCooldown()
    • getSubCommand

      Optional<SubCommandSyntax<S>> getSubCommand(@Nullable @Nullable String name)
      Fetches a subcommand from the name
      Parameters:
      name - subcommand name
      Returns:
      the name of the subcommand