21 November 2007 - java_dev (original) (raw)

| | 10:02 am - ex_juan_gan - I wonder if... there's a better way than declaring from time to time the following map: private static final Map<String, Class> primitiveToClass = new HashMap<String, Class>() {{ put("boolean", Boolean.class); put("double", Double.class); put("float", Float.class); put("long", Long.class); put("int", Integer.class); }}; (Used Crazybob's contraption, but that's not the point.) | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |