public static Class getPrimitiveType ( Class type ) { if ( type == int . class || type == Integer . class ) { return int . class ; } else if ( type == long . class || type == Long . class ) { return long . class ; } else if ( type == short . class || type == Short . class ) { return short . class ; } else if ( type == double . class || type == Double . class ) { return double . class ; } else if ( type == float . class || type == Float . class ) { return float . class ; } else if ( type == char . class || type == Character . class ) { return char . class ; } else if ( type == byte . class || type == Byte . class ) { return byte . class ; } else if ( type == boolean . class || type == Boolean . class ) { return boolean . class ; } throw new IllegalArgumentException ( "Type '" + type + "' can not be converted to primitive type." ) ; }
getPrimitiveType of the given class