select

open fun <R> select(when1: (T1) -> R, when2: (T2) -> R): R(source)

Exhaustively handles the stored value by delegating to the matching lambda.

Return

the result of the handler that matches the concrete option.

Parameters

when1

handler invoked when the receiver is an Option1.

when2

handler invoked when the receiver is an Option2.

See also