select
open fun <R> select(when1: (T1) -> R, when2: (T2) -> R, when3: (T3) -> R, when4: (T4) -> 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.
when3
handler invoked when the receiver is an Option3.
when4
handler invoked when the receiver is an Option4.