Class CommandTree<S>

java.lang.Object
io.github.mqzn.commands.base.tree.CommandTree<S>
Type Parameters:
S - the sender type

public final class CommandTree<S> extends Object
This class represents a tree data structure containing all nodes of subcommands of a particular command.
  • Method Details

    • create

      public static <S> CommandTree<S> create(@NotNull @NotNull Command<S> command)
      Constructs a new CommandTree instance using the command specified for the tree
      Type Parameters:
      S - the sender type
      Parameters:
      command - the command that will hold this tree
      Returns:
      the command tree instance
    • traverse

      public SubCommandSyntax<S> traverse(@NotNull @NotNull DelegateCommandContext<S> context)
      Searches through the subcommands for appropriate subcommand that was used in the context
      Parameters:
      context - the command context determined by the sender
      Returns:
      the subcommand to execute
    • getSubCommand

      @Nullable public @Nullable SubCommandSyntax<S> getSubCommand(String name)
    • getParentalArguments

      @NotNull public @NotNull List<Argument<?>> getParentalArguments(String subCmdName)