String { switch self { case .active: return "active" case .offer: return "offer" case .none: return "nonActive" } } /** * Code in Kotlin */ fun description(description: SomeSealedClass) = when (description) { active -> "active" offer -> "offer" none -> “nonActive" }