Present

data class Present<V>(val value: V) : Optional<V>

Constructors

Link copied to clipboard
constructor(value: V)

Properties

Link copied to clipboard
val value: V

Functions

Link copied to clipboard
fun <V> Optional<V>.getOrElse(fallback: V): V

Returns the value if this Optional is Present or fallback else.

Link copied to clipboard
fun getOrNull(): V?

Returns the value if this Optional is Present or null else.

Link copied to clipboard
fun getOrThrow(): V

Returns the value if this Optional is Present or throws MissingValueException else.

Link copied to clipboard
fun <V, R> Optional<V>.map(mapper: (V) -> R): Optional<R>