Interface ArgumentQueue


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

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

      • pop

        @NotNull Tag.Argument 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

        @NotNull Tag.Argument popOr​(@NotNull
                                    @NotNull 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

        @NotNull Tag.Argument popOr​(@NotNull
                                    @NotNull 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