Koltin, Sealed Classes In Kotlin, Android.
ViewEvent { object Clicked : ViewEvent() data class Swiped(val direction: Direction) : ViewEvent() } sealed class ViewEvent { object Clicked : ViewEvent() data class Swiped(val direction: Direction) : ViewEvent() } Building Algebraic Data Types (ADTs): Sealed classes readily map to ADTs, a