Class GreedyStringArgument

java.lang.Object
me.lucyy.squirtgun.command.argument.AbstractArgument<java.lang.String>
me.lucyy.squirtgun.command.argument.GreedyStringArgument
All Implemented Interfaces:
CommandArgument<java.lang.String>

public final class GreedyStringArgument
extends AbstractArgument<java.lang.String>
An argument that consumes all the available arguments. Note this argument must be the last in a command chain.
  • Constructor Summary

    Constructors
    Constructor Description
    GreedyStringArgument​(java.lang.String name, java.lang.String description, boolean isOptional)  
  • Method Summary

    Modifier and Type Method Description
    java.lang.String getValue​(java.util.Queue<java.lang.String> args)
    Reads from a queue to get the value for this argument.
    @NotNull java.util.List<java.lang.String> tabComplete​(java.util.Queue<java.lang.String> value)
    Tab-completes this node.

    Methods inherited from class me.lucyy.squirtgun.command.argument.AbstractArgument

    getDescription, getName, isOptional, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • GreedyStringArgument

      public GreedyStringArgument​(java.lang.String name, java.lang.String description, boolean isOptional)
      Parameters:
      name - the argument's name
      description - the argument's description
      isOptional - whether the argument is optional
  • Method Details

    • getValue

      public java.lang.String getValue​(java.util.Queue<java.lang.String> args)
      Description copied from interface: CommandArgument
      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

      @NotNull public @NotNull java.util.List<java.lang.String> tabComplete​(java.util.Queue<java.lang.String> value)
      Description copied from interface: CommandArgument
      Tab-completes this node.
      Parameters:
      value - 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