sippo-sdk / com.quobis.sippo.sipposdk.client.model / SippoService

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.

Types

Failure

class Failure<out E : Any> : SippoService<E>

Failed result with error error.

Success

class Success<out V : Any> : SippoService<V>

Successful result with value value.

Functions

error

abstract fun error(): Exception?

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

value

abstract fun value(): V?

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

Extension Functions

failure

fun SippoService<*>.failure(f: (Exception) -> Unit): Unit

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

success

fun <V : Any> SippoService<V>.success(f: (V) -> Unit): Unit

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

Inheritors

Failure

class Failure<out E : Any> : SippoService<E>

Failed result with error error.

Success

class Success<out V : Any> : SippoService<V>

Successful result with value value.