stream

fun stream(): Sequence<T?>

If a value is present, returns a sequential Sequence containing only that value, otherwise returns an empty Sequence.

This method can be used to transform a sequence of optional elements into a sequence of present values.

Return

the optional value as a Sequence