Interface CommandArgument<T>

All Known Implementing Classes:
AbstractArgument, GreedyStringArgument, ListArgument, OnlinePlayerArgument, SingleWordArgument, SubcommandNodeArgument

public interface CommandArgument<T>
An argument.
  • Method Details

    • getName

      @NotNull @NotNull String 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

      T getValue(Queue<String> args, CommandContext 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 List<String> tabComplete(Queue<String> args, CommandContext 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.