blob: 92aba32b34c82a0f9b7f771ae2da9cf1bf81dd4e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
package derms.replica2;
import java.io.Serializable;
enum ResourceType implements Serializable {
AMBULANCE,
FIRETRUCK,
PERSONNEL;
static ResourceType parse(String s) throws IllegalArgumentException {
switch (s) {
case "AMBULANCE": return ResourceType.AMBULANCE;
case "FIRETRUCK": return ResourceType.FIRETRUCK;
case "PERSONNEL": return ResourceType.PERSONNEL;
}
throw new IllegalArgumentException("invalid resource name: "+s);
}
}
|