-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDetailLevel.java
More file actions
30 lines (28 loc) · 930 Bytes
/
DetailLevel.java
File metadata and controls
30 lines (28 loc) · 930 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
public enum DetailLevel {
NOVICE, INTERMEDIATE, ADVANCED, EXPERT, CUSTOM;
public static DetailLevel parse(String in) {
if (in.equals("NOVICE")) return NOVICE;
else if (in.equals("INTERMEDIATE")) return INTERMEDIATE;
else if (in.equals("ADVANCED")) return ADVANCED;
else if (in.equals("EXPERT")) return EXPERT;
else if (in.equals("CUSTOM")) return CUSTOM;
else {
System.err.println("ERROR: Illegal DetailLevel type " + in);
System.exit(1);
return CUSTOM;
}
}
public static String toString(DetailLevel in) {
switch (in) {
case NOVICE: return "NOVICE";
case INTERMEDIATE: return "INTERMEDIATE";
case ADVANCED: return "ADVANCED";
case EXPERT: return "EXPERT";
case CUSTOM: return "CUSTOM";
default:
System.err.println("ERROR: Illegal DetailLevel type " + in);
System.exit(1);
return "Unreachable";
}
}
}