UnexpectedElementException
Date: 2017-02-08

com.github.zafarkhaja.semver.util

## Class UnexpectedElementException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - com.github.zafarkhaja.semver.util.UnexpectedElementException

- All Implemented Interfaces:
    java.io.Serializable

      public class UnexpectedElementException
      extends java.lang.RuntimeException

  Thrown when attempting to consume a stream element of unexpected types.
  Since:
    0.7.0
  See Also:
    `Stream.consume(Stream.ElementType...)`, Serialized Form

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Stream.ElementType<?>[]` | `getExpectedElementTypes()` Gets the expected element types.
    `int` | `getPosition()` Gets the position of the unexpected element.
    `java.lang.Object` | `getUnexpectedElement()` Gets the unexpected element.
    `java.lang.String` | `toString()` Returns the string representation of this exception containing the information about the unexpected element and, if available, about the expected types.

    - ### Methods inherited from class java.lang.Throwable

      `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### getUnexpectedElement

          public java.lang.Object getUnexpectedElement()

      Gets the unexpected element.
      Returns:
        the unexpected element

    - #### getPosition

          public int getPosition()

      Gets the position of the unexpected element.
      Returns:
        the position of the unexpected element

    - #### getExpectedElementTypes

          public Stream.ElementType<?>[] getExpectedElementTypes()

      Gets the expected element types.
      Returns:
        an array of expected element types

    - #### toString

          public java.lang.String toString()

      Returns the string representation of this exception containing the information about the unexpected element and, if available, about the expected types.
      Overrides:
        `toString` in class `java.lang.Throwable`
      Returns:
        the string representation of this exception