Bernhard
04/12/2025, 8:10 PMloke
04/13/2025, 11:29 AMBernhard
04/13/2025, 12:17 PMBernhard
04/13/2025, 12:18 PMBernhard
04/13/2025, 12:19 PMBernhard
04/13/2025, 12:20 PMinterface Translatable {
val i18nKey: String
}
and implement that in the relevant enum classes for each value; however I'm lacking a way to retrieve a key for the class itselfloke
04/13/2025, 2:14 PMname
field to the enum?loke
04/13/2025, 2:16 PMenum class Foo(val name: String) { FOO("xyz"), BAR("qwert") }
loke
04/13/2025, 2:17 PMFoo.FOO::class.name
Bernhard
04/13/2025, 2:23 PMBernhard
04/13/2025, 2:24 PMBernhard
04/13/2025, 2:24 PMloke
04/13/2025, 2:31 PMsealed class Parent {
object Foo : Parent
object Bar : Parent
}
And then use the class name.
But now you say you want named classes.loke
04/13/2025, 2:33 PMloke
04/13/2025, 2:34 PMFoo::class.simpleName
.loke
04/13/2025, 2:34 PM.qualifiedName
that may not be available.loke
04/13/2025, 2:35 PMnull
if the class has no name (if, for example, it is a class of an anonymous object)"Bernhard
04/13/2025, 2:38 PM