/** * Returns the corresponding auto-boxed type if given a primitive type. Returns the given type itself otherwise. */ public static Type boxedType(Type type) { if ( type instanceof Class && ( (Class<?>) type ).isPrimitive() ) { return internalBoxedType( (Class<?>) type ); } else { return type; } }
/** * Returns the corresponding auto-boxed type if given a primitive type. Returns the given type itself otherwise. */ public static Class<?> boxedType(Class<?> type) { if ( type.isPrimitive() ) { return internalBoxedType( (Class<?>) type ); } else { return type; } }