Here you can find the source of toPrimitiveType(Class> type)
public static Class<?> toPrimitiveType(Class<?> type)
//package com.java2s; public class Main { public static Class<?> toPrimitiveType(Class<?> type) { if (type == Boolean.class) return Boolean.TYPE; else if (type == Byte.class) return Byte.TYPE; else if (type == Short.class) return Short.TYPE; else if (type == Integer.class) return Integer.TYPE; else if (type == Long.class) return Long.TYPE; else if (type == Float.class) return Float.TYPE; else if (type == Double.class) return Double.TYPE; else//from w ww. j a v a 2s . co m return type; } }