Package dev.polv.taleapi.command
Class CommandNode.LiteralNode
java.lang.Object
dev.polv.taleapi.command.CommandNode<CommandNode.LiteralNode>
dev.polv.taleapi.command.CommandNode.LiteralNode
- Enclosing class:
- CommandNode<T extends CommandNode<T>>
A literal command node representing fixed text.
Literals match exact text (case-insensitive) and are used for command names and subcommands.
-
Nested Class Summary
Nested classes/interfaces inherited from class dev.polv.taleapi.command.CommandNode
CommandNode.ArgumentNode<V>, CommandNode.LiteralNode -
Field Summary
Fields inherited from class dev.polv.taleapi.command.CommandNode
children, executor, name, requirement -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the usage string for this node.listSuggestions(CommandContext context, SuggestionsBuilder builder) Provides suggestions for autocompletion.booleanChecks if the given input matches this literal.toString()Methods inherited from class dev.polv.taleapi.command.CommandNode
argument, canUse, executes, getChildren, getExecutor, getName, getRequirement, isExecutable, literal, requires, requires, then
-
Constructor Details
-
LiteralNode
Creates a new literal node with the given name.- Parameters:
name- the literal text this node matches
-
-
Method Details
-
getUsageText
Description copied from class:CommandNodeReturns the usage string for this node.- Specified by:
getUsageTextin classCommandNode<CommandNode.LiteralNode>- Returns:
- the usage representation
-
listSuggestions
public CompletableFuture<Suggestions> listSuggestions(CommandContext context, SuggestionsBuilder builder) Description copied from class:CommandNodeProvides suggestions for autocompletion.- Specified by:
listSuggestionsin classCommandNode<CommandNode.LiteralNode>- Parameters:
context- the command contextbuilder- the suggestions builder- Returns:
- a future with suggestions
-
matches
Checks if the given input matches this literal.- Parameters:
input- the input to check- Returns:
trueif the input matches
-
toString
-