Java tutorial
//package com.java2s; public class Main { public static Class<?> wrapperType(Class<?> paramClass) { if (paramClass == Integer.TYPE) return Integer.class; if (paramClass == Long.TYPE) return Long.class; if (paramClass == Boolean.TYPE) return Boolean.class; if (paramClass == Double.TYPE) return Double.class; if (paramClass == Float.TYPE) return Float.class; if (paramClass == Byte.TYPE) return Byte.class; if (paramClass == Short.TYPE) return Short.class; if (paramClass == Character.TYPE) return Character.class; throw new IllegalArgumentException("Class " + paramClass.getName() + " is not a primitive type"); } }