open fun <E : Exception!> getOrThrow(@NonNull exception: Exception): A
Returns Just value or in case of Nothing throws an exception specified as the argument.
exception - Exception: exception that should be thrown if the Maybe is expressing the Nothing case.
- type of the exception thrown.
E - exception thrown in case of Nothing
Return
A: value if Just, throws specified exception otherwise.