Image

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.)