blob: 8acb2e6470948738d881db2cd1b5423c5d2808ac (
plain)
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
|
import java.util.HashMap;
class MyClass {
public enum Primitive {
Boolean ("Boolean"),
Char ("Character"),
Byte ("Byte"),
Short ("Short"),
Int ("Integer"),
Long ("Long"),
Float ("Float"),
Double ("Double");
final String nameOfBoxedType;
}
static final HashMap<String, Primitive> unboxMap = new HashMap<String, Primitive>();
static {
for(Primitive unboxedType : Primitive.values()) {
unboxMap.put(unboxedType.nameOfBoxedType, unboxedType);
}
}
}
|