Add custom value to enum class


#1

Hi, can enum in kotlin have custom val? Like,

enum class Something{
    HELLO{
         val desc = "Hello World"
    }
}

and retrieve it something like

Something.HELLO.desc

Thanks.


#2
enum class Something(val desc: String) {
    HELLO("Hello World")
}