Interface CommandArgument<T>

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

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

    Modifier and Type Method Description
    java.lang.String getDescription()
    Gets this argument's description for use in help commands.
    java.lang.String getName()
    Gets this argument's name.
    T getValue​(java.util.Queue<java.lang.String> args)
    Reads from a queue to get the value for this argument.
    boolean isOptional()
    Gets whether this argument is optional or not.
    @Nullable java.util.List<java.lang.String> tabComplete​(java.util.Queue<java.lang.String> args)
    Tab-completes this node.
  • Method Details

    • getName

      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)
      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.
      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)
      Tab-completes this node.
      Parameters:
      args - a queue of strings containing the raw arguments. Pop as many as needed and no more.
      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.