SippoService

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.

Parameters

V

Type of the value in case of success.

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard
class Failure<out E : Any>(val error: Exception) : SippoService<E>

Failed result with error error.

Link copied to clipboard
class Success<out V : Any>(val value: V) : SippoService<V>

Successful result with value value.

Functions

Link copied to clipboard
abstract fun error(): Exception?

Returns the error associated. In case of Success, error will be null.

Link copied to clipboard

Calls the function f with a specific error when Either is failure.

Link copied to clipboard
fun <V : Any> SippoService<V>.success(f: (V) -> Unit)

Calls the function f with a specific value when SippoService is successful.

Link copied to clipboard
abstract fun value(): V?

Returns the value associated. In case of Failure, value will be null.