I have this enum
:
enum class Types(val value: Int) { FOO(1) BAR(2) FOO_BAR(3)}
How do I create an instance of that enum
using an Int
?
I tried doing something like this:
val type = Types.valueOf(1)
And I get the error:
Integer literal does not conform to the expected type String