Created
July 18, 2013 00:55
-
-
Save chris-martin/6025894 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 EnumBullshit { | |
A(5), B(6), C(-4); | |
public final int i; | |
private static final Map<Integer, EnumBullshit> map = new HashMap<>(); | |
static { | |
for (EnumBullshit bullshit : values()) { | |
map.put(bullshit.i, bullshit); | |
} | |
} | |
private EnumBullshit(int i) { | |
this.i = i; | |
} | |
public static EnumBullshit get(int i) { | |
return map.get(i); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment