data class Failure<out E> : Result<Nothing, E>
Operation failed and returned an associated Exception
error - exception associated to the failed operation
Failure(error: E)
Operation failed and returned an associated Exception |
val error: E
exception associated to the failed operation |
val isError: Boolean
Returns true if the result is a failure |
|
val isSuccess: Boolean
Returns true if the result is a success |
fun getErrorOrNull(): E?
Returns the associated exception error of type E if operation encountered a failure, otherwise null |
|
fun getOrThrow(): V
Returns the associated value of type V if operation was successful, otherwise throws the failure exception |
|
fun getValueOrNull(): V?
Returns the associated value of type V if operation was successful, otherwise null |