java.lang.Object
org.teleight.teleightbots.commands.builder.parser.ArgumentReader

public final class ArgumentReader extends Object
Class representing an argument reader.
  • Constructor Details

    • ArgumentReader

      public ArgumentReader(String input)
      Constructs an ArgumentReader with the specified input string.
      Parameters:
      input - the input string from which arguments are read
  • Method Details

    • hasRemaining

      public boolean hasRemaining()
      Checks if there are more characters to read in the input string.
      Returns:
      true if there are more characters to read, false otherwise
    • readWord

      @NotNull public @NotNull String readWord()
      Reads the next word from the input string.

      A word is defined as a sequence of characters separated by spaces. The cursor is moved to the position after the read word.

      Returns:
      the read word
    • readRemaining

      @NotNull public @NotNull String readRemaining()
      Reads the remaining characters from the input string.

      The cursor is moved to the end of the input string.

      Returns:
      the remaining characters
    • resetCursor

      public void resetCursor()
      Resets the cursor to the start of the input string.