Class SubcommandNodeArgument

java.lang.Object
net.lucypoulton.squirtgun.command.argument.AbstractArgument<CommandNode<?>>
net.lucypoulton.squirtgun.command.node.subcommand.SubcommandNodeArgument
All Implemented Interfaces:
CommandArgument<CommandNode<?>>

public class SubcommandNodeArgument extends AbstractArgument<CommandNode<?>>
  • Constructor Details

    • SubcommandNodeArgument

      public SubcommandNodeArgument(SubcommandNode parent, String name, String description)
      Parameters:
      parent - the node this argument belongs to
      name - the argument's name
      description - the argument's description
  • Method Details

    • getValue

      public CommandNode<?> getValue(Queue<String> args, CommandContext context)
      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.
      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 public @Nullable List<String> tabComplete(Queue<String> args, CommandContext context)
      Description copied from interface: CommandArgument
      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

      public boolean isOptional()
      Description copied from interface: CommandArgument
      Gets whether this argument is optional or not. This should not change how the argument behaves.
      Specified by:
      isOptional in interface CommandArgument<CommandNode<?>>
      Overrides:
      isOptional in class AbstractArgument<CommandNode<?>>