flatMap
|
abstract fun <R> flatMap(function: (T) -> R): R? fun flatMap(): T?
Flatmap the identity function. Basically this gives the value for Ok, null when cancelled or
throws the exception for an error state.
|
map
|
fun <R> map(function: (T) -> R): Maybe<R>
Create a new maybe with the function applied to the data (on Ok values only).
|
onCancelled
|
fun onCancelled(function: CancellationCallback): Unit?
fun <R> onCancelled(function: Cancelled.() -> R): R? |
onError
|
fun onError(function: ErrorCallback): Unit?
fun <R> onError(function: Error.(Exception) -> R): R? |
onOk
|
fun onOk(function: SuccessCallback<T>): Unit?
fun <R> onOk(function: Ok<*>.(T) -> R): R? |
select
|
abstract fun <T> select(ok: T, cancelled: T, error: T): T |