Created
July 8, 2017 06:14
-
-
Save ppazos/ea8288e32b2049b401515f2b6956beab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum ChangeType { | |
CREATION(249 as short), | |
AMENDMENT(250 as short), | |
MODIFICATION(251 as short), | |
DELETED(523 as short) | |
// TODO: SYNTHESIS, ATTESTATION, UNKNOWN? | |
private final short value | |
short getValue() | |
{ | |
return this.value | |
} | |
ChangeType(short val) | |
{ | |
this.value = val | |
} | |
static ChangeType fromValue(short v) | |
{ | |
for(ChangeType e: ChangeType.values()) | |
{ | |
if(e.value == v) | |
{ | |
return e; | |
} | |
} | |
return null;// not found | |
} | |
} | |
println ChangeType.values() | |
//ChangeType(249 as short) | |
def a = ChangeType.fromValue(249 as short) | |
println a | |
a = ChangeType.fromValue('2450' as short) | |
println a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment