OneOf3

sealed interface OneOf3<out T1, out T2, out T3> : OneOf(source)

Three-way discriminated union.

Inheritors

Types

Link copied to clipboard
value class Option1<T>(val value: T) : OneOf3<T, Nothing, Nothing>

Represents the first alternative of the union. @property value payload chosen for the first branch.

Link copied to clipboard
value class Option2<T>(val value: T) : OneOf3<Nothing, T, Nothing>

Represents the second alternative of the union. @property value payload chosen for the second branch.

Link copied to clipboard
value class Option3<T>(val value: T) : OneOf3<Nothing, Nothing, T>

Represents the third alternative of the union. @property value payload chosen for the third branch.

Functions

Link copied to clipboard
open fun <R> select(when1: (T1) -> R, when2: (T2) -> R, when3: (T3) -> R): R

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