doc / ch.tutteli.atrium.core / Option

Option

sealed class Option<out T> (source)

Represents an optional value with map, flatMap, fold and getOrElse to transform it.

Functions

filter

fun filter(predicate: (T) -> Boolean): Option<T>

flatMap

fun <R> flatMap(f: (T) -> Option<R>): Option<R>

fold

fun <R> fold(default: () -> R, f: (T) -> R): R

isDefined

fun isDefined(): Boolean

map

fun <R> map(f: (T) -> R): Option<R>

Companion Object Functions

someIf

fun <T> someIf(predicate: Boolean, provider: () -> T): Option<T>

Extension Functions

getOrElse

fun <T> Option<T>.getOrElse(default: () -> T): T

Inheritors

None

object None : Option<Nothing>

Represents an absent value in terms of Option.

Some

data class Some<T> : Option<T>

Represents a present value in terms of Option.