Class SubcommandNodeArgument
java.lang.Object
net.lucypoulton.squirtgun.command.argument.AbstractArgument<CommandNode<?>>
net.lucypoulton.squirtgun.command.node.subcommand.SubcommandNodeArgument
- All Implemented Interfaces:
CommandArgument<CommandNode<?>>
-
Constructor Summary
ConstructorsConstructorDescriptionSubcommandNodeArgument(SubcommandNode parent, String name, String description) -
Method Summary
Modifier and TypeMethodDescriptionCommandNode<?>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.Methods inherited from class net.lucypoulton.squirtgun.command.argument.AbstractArgument
getDescription, getName, toString
-
Constructor Details
-
SubcommandNodeArgument
- Parameters:
parent- the node this argument belongs toname- the argument's namedescription- the argument's description
-
-
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.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
Description copied from interface:CommandArgumentTab-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
public boolean isOptional()Description copied from interface:CommandArgumentGets whether this argument is optional or not. This should not change how the argument behaves.- Specified by:
isOptionalin interfaceCommandArgument<CommandNode<?>>- Overrides:
isOptionalin classAbstractArgument<CommandNode<?>>
-