If you have full control of values and enums, and they're sequential, you can use the enum ordinal value:
enum Heyo
{
FirstVal, SecondVal
}
...later
int systemVal = [whatever];
Heyo enumVal = Heyo.values()[systemVal];
int againSystemVal = enumVal.ordinal();
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…