of

fun <T> of(value: T): Optional<T>

Returns an Optional describing the given non-null value.

Return

an Optional with the value present

Parameters

value

the value to describe, which must be non-null

Type Parameters

T

the type of the value

Throws

if value is null