scala - how can I initialize an enum from an Int or Byte? -


i have enum this:

object ops extends enumeration {   val 1 = value(0x01)   val 2 = value(0x02)   val 3 = value(0x03)   val 4 = value(0x04) } 

i want say

byte somebyte = functionthatreturnsabyte val op = ops.valueof(somebyte) 

the method close withname takes string.

ops(somebyte) 

will trick.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -