Module com.github.zafarkhaja.semver
Class UnexpectedElementException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.github.zafarkhaja.semver.util.UnexpectedElementException
- All Implemented Interfaces:
Serializable
Thrown when attempting to consume a stream element of unexpected types.
- Since:
- 0.7.0
- Author:
- Zafar Khaja <zafarkhaja@gmail.com>
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionStream.ElementType<?>[]
Gets the expected element types.int
Gets the position of the unexpected element.Gets the unexpected element.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
-
Method Details
-
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
Gets the expected element types.- Returns:
- an array of expected element types
-
toString
Returns the string representation of this exception containing the information about the unexpected element and, if available, about the expected types.
-