Result

abstract class Result<T>

Result can be 3 valued:

  • Empty
  • Value
  • Failure
Empty and Value are used to distinguish the logical empty with the null result.

Failure in a ready result is always a user failure, and never a syscall failure, as opposed to onCancel.

Parameters

<T>

result type

Functions

Link copied to clipboard
open fun <T> empty(): Result<T>
Link copied to clipboard
Link copied to clipboard
@Nullable
abstract fun getFailure(): @Nullable TerminalException
Link copied to clipboard
@Nullable
abstract fun getValue(): @Nullable T
Link copied to clipboard
abstract fun isEmpty(): Boolean
Link copied to clipboard
abstract fun isSuccess(): Boolean
Link copied to clipboard
open fun <U> mapSuccess(mapper: (T) -> U): Result<U>
Map this result success value.
Link copied to clipboard
open fun <T> success(value: T): Result<T>