Class ListArgument
java.lang.Object
net.lucypoulton.squirtgun.command.argument.AbstractArgument<String>
net.lucypoulton.squirtgun.command.argument.ListArgument
- All Implemented Interfaces:
CommandArgument<String>
An argument that accepts a single string from a list.
-
Constructor Summary
ConstructorsConstructorDescriptionListArgument(String name, String description, boolean isOptional, List<String> values) -
Method Summary
Modifier and TypeMethodDescriptiongetValue(Queue<String> args, CommandContext ctx)Reads from a queue to get the value for this argument.tabComplete(Queue<String> value, CommandContext ctx)Tab-completes this node.Methods inherited from class net.lucypoulton.squirtgun.command.argument.AbstractArgument
getDescription, getName, isOptional, toString
-
Constructor Details
-
ListArgument
- Parameters:
name- this argument's namedescription- this argument's descriptionisOptional- whether this argument will be displayed as optionalvalues- a set of acceptable values for this argument
-
-
Method Details
-
getValue
Description copied from interface:CommandArgumentReads 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.ctx- 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
Description copied from interface:CommandArgumentTab-completes this node.- Parameters:
value- a queue of strings containing the raw arguments. Pop as many as needed and no more.ctx- 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
-