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.

This class extends the Argument class with a type parameter of String. It overrides the parse method of the Argument class to return the input string as it is.

  • Field Summary

    Fields inherited from class org.teleight.teleightbots.commands.builder.argument.Argument

    id
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs an ArgumentString with the specified identifier.
    ArgumentString(String id, boolean readRemaining)
    Constructs an ArgumentString with the specified identifier and a boolean indicating whether to read the remaining input or not.
  • Method Summary

    Modifier and Type
    Method
    Description
    parse(String input)
    Returns the input string as it is.
    boolean
    Returns the value of the readRemaining field.

    Methods inherited from class org.teleight.teleightbots.commands.builder.argument.Argument

    equals, getId, hashCode

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ArgumentString

      public ArgumentString(String id, boolean readRemaining)
      Constructs an ArgumentString with the specified identifier and a boolean indicating whether to read the remaining input or not.
      Parameters:
      id - the identifier of the argument
      readRemaining - a boolean indicating whether to read the remaining input or not
    • ArgumentString

      public ArgumentString(String id)
      Constructs an ArgumentString with the specified identifier. The readRemaining 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
    • readRemaining

      public boolean readRemaining()
      Returns the value of the readRemaining field.
      Returns:
      the value of the readRemaining field