Class ArgumentString

java.lang.Object
org.teleight.teleightbots.commands.builder.argument.Argument<String>
org.teleight.teleightbots.commands.builder.argument.ArgumentString

public class ArgumentString extends Argument<String>
Class representing a string argument.
  • Constructor Details

    • ArgumentString

      public ArgumentString(String id, boolean greedyMatch)
      Constructs an ArgumentString with the specified identifier.
      Parameters:
      id - the identifier of the argument
      greedyMatch - if true, this argument will consume all remaining input until the end of the message; if false, it will only consume a single word
    • ArgumentString

      public ArgumentString(String id)
      Constructs an ArgumentString with the specified identifier. The greedyMatch field is set to false by default.
      Parameters:
      id - the identifier of the argument
  • Method Details

    • parse

      public String parse(String input) throws ArgumentSyntaxException
      Returns the input string as it is.
      Specified by:
      parse in class Argument<String>
      Parameters:
      input - the input string to be parsed
      Returns:
      the input string as it is
      Throws:
      ArgumentSyntaxException - if the input string cannot be parsed
    • greedy

      public boolean greedy()
      Returns whether this argument greedily consumes all remaining input.
      Returns:
      true if this argument consumes all remaining input, false otherwise