Class SubcommandNodeArgument<T extends me.lucyy.squirtgun.platform.audience.PermissionHolder>
- java.lang.Object
-
- me.lucyy.squirtgun.command.argument.AbstractArgument<CommandNode<T>>
-
- me.lucyy.squirtgun.command.node.subcommand.SubcommandNodeArgument<T>
-
- All Implemented Interfaces:
CommandArgument<CommandNode<T>>
public class SubcommandNodeArgument<T extends me.lucyy.squirtgun.platform.audience.PermissionHolder> extends AbstractArgument<CommandNode<T>>
-
-
Constructor Summary
Constructors Constructor Description SubcommandNodeArgument(SubcommandNode<T> parent, java.lang.String name, java.lang.String description)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CommandNode<T>getValue(java.util.Queue<java.lang.String> args, CommandContext<?> context)Reads from a queue to get the value for this argument.booleanisOptional()Gets whether this argument is optional or not.@Nullable java.util.List<java.lang.String>tabComplete(java.util.Queue<java.lang.String> args, CommandContext<?> context)Tab-completes this node.-
Methods inherited from class me.lucyy.squirtgun.command.argument.AbstractArgument
getDescription, getName, toString
-
-
-
-
Constructor Detail
-
SubcommandNodeArgument
public SubcommandNodeArgument(SubcommandNode<T> parent, java.lang.String name, java.lang.String description)
- Parameters:
parent- the node this argument belongs toname- the argument's namedescription- the argument's description
-
-
Method Detail
-
getValue
public CommandNode<T> getValue(java.util.Queue<java.lang.String> args, CommandContext<?> context)
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
@Nullable public @Nullable java.util.List<java.lang.String> tabComplete(java.util.Queue<java.lang.String> args, CommandContext<?> context)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<T extends me.lucyy.squirtgun.platform.audience.PermissionHolder>- Overrides:
isOptionalin classAbstractArgument<CommandNode<T extends me.lucyy.squirtgun.platform.audience.PermissionHolder>>
-
-