data class Failure<out E : Throwable> : Either<Nothing, E>
Failed result with error error.
E
- Type of the error. It has to extend Throwable.
Failure(error: E)
Failed result with error error. |
val error: E |
val isFailure: Boolean
True if the result is an error, false otherwise. |
|
val isSuccess: Boolean
True if the result was successful, false otherwise. |
fun error(): E
Returns the error associated. In case of Success, error will be null. |
|
fun value(): Nothing?
Returns the value associated. In case of Failure, value will be null. |