07-20-2023, 06:27 AM
I want to define an enum that values are not ordinal, for example:
enum class States(value: Int) {
STATE_A(4),
STATE_B(5),
STATE_C(7),
STATE_D(12)
}
How can I get the value of each item? For instance **States.STATE_C** should return **7**.
enum class States(value: Int) {
STATE_A(4),
STATE_B(5),
STATE_C(7),
STATE_D(12)
}
How can I get the value of each item? For instance **States.STATE_C** should return **7**.