sealed class SippoService<out V : Any>
A Sippo service.
This class groups all the methods needed in order to manage an asynchronous result when asking for services that requires certain user capabilities.
V
- Type of the value in case of success.
class Failure<out E : Any> : SippoService<E>
Failed result with error error. |
|
class Success<out V : Any> : SippoService<V>
Successful result with value value. |
abstract fun error(): Exception?
Returns the error associated. In case of Success, error will be null. |
|
abstract fun value(): V?
Returns the value associated. In case of Failure, value will be null. |
fun SippoService<*>.failure(f: (Exception) -> Unit): Unit
Calls the function f with a specific error when Either is failure. |
|
fun <V : Any> SippoService<V>.success(f: (V) -> Unit): Unit
Calls the function f with a specific value when SippoService is successful. |
class Failure<out E : Any> : SippoService<E>
Failed result with error error. |
|
class Success<out V : Any> : SippoService<V>
Successful result with value value. |