Companion

object Companion

Functions

Link copied to clipboard
fun <T> empty(): Optional<T>

Returns an empty Optional instance. No value is present for this Optional.

Link copied to clipboard
fun <T> of(value: T): Optional<T>

Returns an Optional describing the given non-null value.

Link copied to clipboard
fun <T> ofNullable(value: T?): Optional<T?>

Returns an Optional describing the given value, if non-null, otherwise returns an empty Optional.