diesieben07
06/22/2017, 9:40 AMjasonlow
06/22/2017, 9:43 AMBILL("Bill")
?foo.valueOf("Bill")
?diesieben07
06/22/2017, 9:50 AMBILL
and TOP_UP
. "Bill"
is just a value of the transactionType
field in the enum constant object. The name of your enum constants (used with valueOf
) is "BILL"
and "TOP_UP"
in your case.transactionType
field you would use foo.values().firstOrNull { it.transactionType == "bill" }
jasonlow
06/22/2017, 10:00 AMkarelpeeters
06/22/2017, 11:02 AMfoo.valueOf("BILL")
would have worked too.