common / com.schibsted.account.common.lib

Package com.schibsted.account.common.lib

Types

Either

sealed class Either<out L, out R>

Left

data class Left<out L> : Either<L, Nothing>

ObservableField

class ObservableField<T>

Allows to reactively observe value and its changes. Emitted values are guaranteed to be distinct.

Octuple

data class Octuple<out A, out B, out C, out D, out E, out F, out G, out H>

Quadruple

data class Quadruple<out A, out B, out C, out D>

Quintuple

data class Quintuple<out A, out B, out C, out D, out E>

Right

data class Right<out T> : Either<Nothing, T>

Septuple

data class Septuple<out A, out B, out C, out D, out E, out F, out G>

Sextuple

data class Sextuple<out A, out B, out C, out D, out E, out F>

Try

sealed class Try<out T>

Functions

apply

infix fun <L, R, O> Either<L, (R) -> O>.apply(f: Either<L, R>): Either<L, O>

flatMap

infix fun <L, R, O> Either<L, R>.flatMap(f: (R) -> Either<L, O>): Either<L, O>

fold

fun <L, R, O> Either<L, R>.fold(lf: (L) -> O, rf: (R) -> O): O

getOrDefault

fun <O> Try<O>.getOrDefault(default: () -> O): O

getOrElse

fun <O> Try<O>.getOrElse(default: (Throwable) -> O): O

getOrNull

fun <O> Try<O>.getOrNull(): O?

map

infix fun <L, R, O> Either<L, R>.map(f: (R) -> O): Either<L, O>

mapLeft

infix fun <L, R, O> Either<L, O>.mapLeft(f: (L) -> R): Either<R, O>

recover

fun <O> Try<O>.recover(onError: (Throwable) -> O): Try<O>

recoverWith

fun <O> Try<O>.recoverWith(onError: (Throwable) -> Try<O>): Try<O>