val statusType: ReturnASealedClass get() = when (statusIsAnIntFrom1To9FromTheApi) { 1 -> ChildObject1 2 -> ChildObject2 3 -> ChildObject3 4 -> ChildObject4 5 -> ChildObject5 6 -> ChildObject6 7 -> ChildObject7 8 -> ChildObject8 9 -> ChildObject9 else -> throw IllegalStateException("Status not supported") } val isOpenOrClosed get() = when (statusType) { ChildObject1,//All these Object inherit from FatherObject ChildObject2 ChildObject3 -> IamAnEnumWithTwoStatesOpenORCLoses.CLOSED else -> IamAnEnumWithTwoStatesOpenORCLoses.OPEN }