Interface CommandArgument<T>
-
- All Known Implementing Classes:
AbstractArgument,GreedyStringArgument,ListArgument,OnlinePlayerArgument,SingleWordArgument,SubcommandNodeArgument
public interface CommandArgument<T>An argument.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetDescription()Gets this argument's description for use in help commands.@NotNull java.lang.StringgetName()Gets this argument's name.TgetValue(java.util.Queue<java.lang.String> args, CommandContext<? extends me.lucyy.squirtgun.platform.audience.PermissionHolder> 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<? extends me.lucyy.squirtgun.platform.audience.PermissionHolder> context)Tab-completes this node.
-
-
-
Method Detail
-
getName
@NotNull @NotNull java.lang.String getName()
Gets this argument's name.- Returns:
- the name
-
getDescription
java.lang.String getDescription()
Gets this argument's description for use in help commands. This should be a simple, one-line sentence.- Returns:
- the description
-
getValue
T getValue(java.util.Queue<java.lang.String> args, CommandContext<? extends me.lucyy.squirtgun.platform.audience.PermissionHolder> context)
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
@Nullable @Nullable java.util.List<java.lang.String> tabComplete(java.util.Queue<java.lang.String> args, CommandContext<? extends me.lucyy.squirtgun.platform.audience.PermissionHolder> context)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.
-
-