public static Class getPrimitiveWrapper ( final Class type ) { if ( ! type . isPrimitive ( ) ) { throw new IllegalArgumentException ( "type is not a primitive class" ) ; } for ( int i = 0 ; i < PRIMITIVE_WRAPPER_MAP . length ; i += 2 ) { if ( type . equals ( PRIMITIVE_WRAPPER_MAP [ i ] ) ) return PRIMITIVE_WRAPPER_MAP [ i + 1 ] ; } // should never get here, if we do then PRIMITIVE_WRAPPER_MAP // needs to be updated to include the missing mapping throw new UnreachableStatementException ( ) ; }
Get the wrapper class for the given primitive type .