ApiResult
A class that represents a result of an operation.
This class is efficient:
no actual objects are created,
all operations are inlined
no function resolution is performed.
ApiResult is not an Rx-style callback chain - the operators that are invoked are called immediately and in-place.
Properties
Link copied to clipboard
ApiResult.Error.e's cause
Link copied to clipboard
ApiResult.Error.e's message.
Link copied to clipboard
ApiResult.Error.e's stack trace as string
Functions
Link copied to clipboard
Link copied to clipboard
Get the Success component of this result or null
Link copied to clipboard
Get the Error component of this result or null
Link copied to clipboard
inline fun <T, R : Iterable<T>> ApiResult<R>.errorIfEmpty(exception: () -> Exception = { ConditionNotSatisfiedException("Collection was empty") }): ApiResult<R>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Throws ApiResult.Error.e, or NotFinishedException if the request has not been completed yet.
Link copied to clipboard
Link copied to clipboard
inline fun <T> ApiResult<T?>?.requireNotNull(message: () -> String = { "ApiResult value was null" }): ApiResult<T & Any>
Alias for errorOnNull
Link copied to clipboard