public final class CommandResolver
extends java.lang.Object
BladeCommand| Constructor and Description |
|---|
CommandResolver(Blade blade) |
| Modifier and Type | Method and Description |
|---|---|
<T extends Container> |
findContainer(@NotNull BladeCommand command)
Finds the container associated with the given command.
|
<T extends Container> |
findContainer(@NotNull ResolvedCommand node)
Finds the container associated with the given resolved command node.
|
@Nullable ResolvedCommand |
findExactMatch(@NotNull java.lang.String input)
Attempts to find an exact command match.
|
@Nullable ResolvedCommand |
resolve(@NotNull java.lang.String input)
Resolves the command node for the given input.
|
public CommandResolver(Blade blade)
@Nullable public @Nullable ResolvedCommand resolve(@NotNull @NotNull java.lang.String input)
For exact matches, returns the specific command. For partial matches, returns a stub containing all possible subcommands.
input - the input command stringnull if no matching commands are found@ApiStatus.Internal @Nullable public @Nullable ResolvedCommand findExactMatch(@NotNull @NotNull java.lang.String input)
input - the normalized input stringnull if no match exists@Nullable public <T extends Container> T findContainer(@NotNull @NotNull ResolvedCommand node)
T - the type of container to findnode - the resolved command nodenull if none is found@Nullable public <T extends Container> T findContainer(@NotNull @NotNull BladeCommand command)
T - the type of container to findcommand - the command to find the container fornull if none is found