diesieben07
06/22/2017, 9:40 AMjasonlow
06/22/2017, 9:43 AMBILL("Bill")
?jasonlow
06/22/2017, 9:44 AMfoo.valueOf("Bill")
?jasonlow
06/22/2017, 9:45 AMdiesieben07
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.diesieben07
06/22/2017, 9:51 AMtransactionType
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.