Interface CommandArgument<T>
- All Known Implementing Classes:
AbstractArgument,GreedyStringArgument,ListArgument,OnlinePlayerArgument,SingleWordArgument,SubcommandNodeArgument
public interface CommandArgument<T>
An argument.
-
Method Summary
Modifier and TypeMethodDescriptionGets this argument's description for use in help commands.@NotNull StringgetName()Gets this argument's name.getValue(Queue<String> args, CommandContext context) Reads from a queue to get the value for this argument.booleanGets whether this argument is optional or not.tabComplete(Queue<String> args, CommandContext context) Tab-completes this node.
-
Method Details
-
getName
Gets this argument's name.- Returns:
- the name
-
getDescription
String getDescription()Gets this argument's description for use in help commands. This should be a simple, one-line sentence.- Returns:
- the description
-
getValue
Reads from a queue to get the value for this argument.- Parameters:
args- a queue of strings containing the raw arguments. Pop as many as needed and no more.context- the context that this command has been executed in. Be aware that arguments may not yet be populated.- Returns:
- the parsed string value of this argument.
-
tabComplete
Tab-completes this node.- Parameters:
args- a queue of strings containing the raw arguments. Pop as many as needed and no more.context- the context that this command has been executed in. Be aware that arguments may not yet be populated.- Returns:
- the tabcompleted value of this node, or if not applicable, null
-
isOptional
boolean isOptional()Gets whether this argument is optional or not. This should not change how the argument behaves.
-