@NonExtendable public interface ArgumentQueue
A queue of Tag arguments.
Since:
4.10.0
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Get whether another argument is available to be popped.
    @Nullable Tag.Argument
    Peek at the next argument without advancing the iteration pointer.
    pop()
    Pop an argument, throwing an exception if no argument was present.
    popOr(String errorMessage)
    Pop an argument, throwing an exception if no argument was present.
    popOr(Supplier<String> errorMessage)
    Pop an argument, throwing an exception if no argument was present.
    void
    Reset index to the beginning, to begin another attempt.
  • Method Details

    • pop

      Pop an argument, throwing an exception if no argument was present.

      After an invocation of pop(), the internal argument pointer will be advanced to the next argument.

      Returns:
      the popped argument
      Since:
      4.10.0
    • popOr

      Tag.Argument popOr(String errorMessage)
      Pop an argument, throwing an exception if no argument was present.

      After an invocation of popOr(), the internal argument pointer will be advanced to the next argument.

      Parameters:
      errorMessage - the error to throw if the argument is not present
      Returns:
      the popped argument
      Since:
      4.10.0
    • popOr

      Tag.Argument popOr(Supplier<String> errorMessage)
      Pop an argument, throwing an exception if no argument was present.

      After an invocation of popOr(), the internal argument pointer will be advanced to the next argument.

      Parameters:
      errorMessage - the error to throw if the argument is not present
      Returns:
      the popped argument
      Since:
      4.10.0
    • peek

      @Nullable Tag.Argument peek()
      Peek at the next argument without advancing the iteration pointer.
      Returns:
      the next argument, if any is available.
      Since:
      4.10.0
    • hasNext

      boolean hasNext()
      Get whether another argument is available to be popped.
      Returns:
      whether another argument is available
      Since:
      4.10.0
    • reset

      void reset()
      Reset index to the beginning, to begin another attempt.
      Since:
      4.10.0