y
11/10/2022, 12:43 PMMichael de Kaste
11/10/2022, 1:38 PMwhen(yourClassInstance){
is State1 -> doState1Thing()
is State2 -> doState2Thing()
}
or otherwise, you can just get the class with
yourClassInstance::class
y
11/10/2022, 1:39 PMy
11/10/2022, 1:39 PMy
11/10/2022, 1:40 PMsomeClass::class
going to be the same for each run, and independent of the state of the that class’s instance?Stephan Schroeder
11/10/2022, 1:42 PMMichael de Kaste
11/10/2022, 1:42 PMy
11/10/2022, 1:44 PMMichael de Kaste
11/10/2022, 1:44 PMSealedParent::class.sealedSubclasses
y
11/10/2022, 1:46 PMy
11/10/2022, 1:46 PMKClass
.Michael de Kaste
11/10/2022, 1:48 PMyourClassInstance::class.simpleName
it all depends on your usecasey
11/10/2022, 1:50 PMwhen
clauses to translate to/from some compact representation like a byte.y
11/10/2022, 1:50 PMy
11/10/2022, 1:50 PMy
11/10/2022, 1:51 PMMichael de Kaste
11/10/2022, 1:51 PMMichael de Kaste
11/10/2022, 1:52 PM