Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public enum ORFMatch
- {
- PERMIT(0),
- DENY(1);
- private int code;
- ORFMatch(int code)
- {
- this.code = code;
- }
- public int getCode()
- {
- return code;
- }
- public static ORFMatch fromCode(int code)
- {
- return Arrays.stream(ORFMatch.values())
- .filter(orfMatch -> orfMatch.getCode() == code)
- .findFirst()
- .orElseThrow(() -> new IllegalArgumentException("unknown ORF action code: " + code));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment