Class SingleWordArgument

  • All Implemented Interfaces:
    CommandArgument<java.lang.String>

    public final class SingleWordArgument
    extends AbstractArgument<java.lang.String>
    An argument that accepts a single word.
    • Constructor Summary

      Constructors 
      Constructor Description
      SingleWordArgument​(java.lang.String name, java.lang.String description, boolean isOptional)  
    • Constructor Detail

      • SingleWordArgument

        public SingleWordArgument​(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 Detail

      • getValue

        public java.lang.String getValue​(java.util.Queue<java.lang.String> args,
                                         CommandContext<?> ctx)
        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.
        ctx - 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

        @NotNull
        public @NotNull java.util.List<java.lang.String> tabComplete​(java.util.Queue<java.lang.String> value,
                                                                     CommandContext<?> ctx)
        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.
        ctx - 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