Class CommandTree<S>
java.lang.Object
io.github.mqzn.commands.base.tree.CommandTree<S>
- Type Parameters:
S
- the sender type
This class represents a tree data structure
containing all nodes of subcommands of a
particular command.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
static enum
-
Method Summary
Modifier and TypeMethodDescriptionstatic <S> CommandTree<S>
Constructs a new CommandTree instance using the command specified for the treestatic <S> @Nullable String
getLastRawArgument
(@NotNull DelegateCommandContext<S> context) getParentalArguments
(String subCmdName) @Nullable SubCommandSyntax<S>
getSubCommand
(String name) @NotNull CommandTree.TraversingResult<S>
traverse
(@NotNull DelegateCommandContext<S> context) Searches through the subcommands for appropriate subcommand that was used in the context
-
Method Details
-
create
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
-
getLastRawArgument
@Nullable public static <S> @Nullable String getLastRawArgument(@NotNull @NotNull DelegateCommandContext<S> context) -
traverse
@NotNull public @NotNull CommandTree.TraversingResult<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
-
getParentalArguments
-