private Class mapPrimitive ( Class clazz ) { if ( clazz == Integer . TYPE ) { return Integer . class ; } if ( clazz == Double . TYPE ) { return Double . class ; } if ( clazz == Float . TYPE ) { return Float . class ; } if ( clazz == Boolean . TYPE ) { return Boolean . class ; } if ( clazz == Long . TYPE ) { return Long . class ; } throw new RuntimeException ( "Unsupported primitive: " + clazz ) ; }
Map a primitive class type to it s real object wrapper