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 unboxMap = new HashMap(); static { for(Primitive unboxedType : Primitive.values()) { unboxMap.put(unboxedType.nameOfBoxedType, unboxedType); } } }