Success¶
The latest known result of the operation was a success, available as value.
Constructors¶
Success¶
constructor(value: Value)
Properties¶
failure¶
failureOrNull¶
Returns Failure.failure, or null if this outcome is not a failure.
value¶
value¶
valueOrNull¶
Returns Success.value, or null if this outcome is not successful.
Functions¶
map¶
inline fun <Failure, InputValue, OutputValue> Outcome<Failure, InputValue>.map(transform: (InputValue) -> OutputValue): Outcome<Failure, OutputValue>
If this outcome is successful, replaces its value using transform.
If this outcome isn't successful, does nothing.
See also
mapFailure: Map the failure state instead of the success state.
mapFailure¶
inline fun <InputFailure, Value, OutputFailure> Outcome<InputFailure, Value>.mapFailure(transformFailure: (InputFailure) -> OutputFailure): Outcome<OutputFailure, Value>
If this outcome is failed, replaces its failure using transformFailure.
If this outcome isn't failed, does nothing.
See also
map: Map the success state instead of the failure state.
onFailure¶
onSuccess¶
Executes block if this outcome is successful.
Otherwise, does nothing.
toEither¶
withProgress¶
fun <Failure, Value> Outcome<Failure, Value>.withProgress(progress: Progress = done()): ProgressiveOutcome<Failure, Value>
Adds progress information to this outcome to make it a ProgressiveOutcome.