cast a primitive type class definition to his object reference type

@param clazz class object to check and convert if it is of primitive type
@return object reference class object
187049
private static Class primitiveToWrapperType(Class clazz) {
	// boolean, byte, char, short, int, long, float, and double
	if (clazz == null) return null;
	else if (clazz.isPrimitive()) {
	    if (clazz.getName().equals("boolean")) return Boolean.class;
	    else if (clazz.getName().equals("byte")) return Byte.class;
	    else if (clazz.getName().equals("char")) return Character.class;
	    else if (clazz.getName().equals("short")) return Short.class;
	    else if (clazz.getName().equals("int")) return Integer.class;
	    else if (clazz.getName().equals("long")) return Long.class;
	    else if (clazz.getName().equals("float")) return Float.class;
	    else if (clazz.getName().equals("double")) return Double.class;
	}
	return clazz;
    }
394045
public static String type(Class<? extends ParaObject> clazz) {
		return (clazz == null) ? "" : clazz.getSimpleName().toLowerCase();
	}
828687
public static Object castNumberType(Object object, Class clazz) {

        if (Number.class.isAssignableFrom(clazz)) {
            //            AtomicInteger, AtomicLong, BigDecimal, BigInteger, Byte, Double, Float, Integer, Long, Short
            if (Double.class.isAssignableFrom(clazz)) {
                return ((Number) object).doubleValue();
            } else if (Long.class.isAssignableFrom(clazz)) {
                return ((Number) object).longValue();

            } else if (Float.class.isAssignableFrom(clazz)) {
                return ((Number) object).floatValue();

            } else if (Integer.class.isAssignableFrom(clazz)) {
                return ((Number) object).intValue();

            } else if (Short.class.isAssignableFrom(clazz)) {
                return ((Number) object).shortValue();

            } else if (Byte.class.isAssignableFrom(clazz)) {
                return ((Number) object).byteValue();

            } else if (BigInteger.class.isAssignableFrom(clazz)) {
                return BigInteger.valueOf(((Number) object).longValue());

            } else if (BigDecimal.class.isAssignableFrom(clazz)) {
                return BigDecimal.valueOf(((Number) object).longValue());

            } else if (AtomicLong.class.isAssignableFrom(clazz)) {
                return new AtomicLong(((Number) object).longValue());

            } else if (AtomicInteger.class.isAssignableFrom(clazz)) {
                return new AtomicInteger(((Number) object).intValue());
            }
        }
        throw new ClassCastException("it is not a Number Type" + object.getClass() + "|" + clazz);
    }
1135425
public static final Class<?> getPrimitiveClass(Class<?> clazz)
    {
        Class<?> retValue = clazz;
        if (clazz == java.lang.Long.class)
        {
            retValue = Long.TYPE;
        } else if (clazz == java.lang.Integer.class)
        {
            retValue = Integer.TYPE;
        } else if (clazz == java.lang.Boolean.class)
        {
            retValue = Boolean.TYPE;
        } else if (clazz == java.lang.Short.class)
        {
            retValue = Short.TYPE;
        } else if (clazz == java.lang.Byte.class)
        {
            retValue = Byte.TYPE;
        } else if (clazz == java.lang.Character.class)
        {
            retValue = Character.TYPE;
        } else if (clazz == java.lang.Double.class)
        {
            retValue = Double.TYPE;
        } else if (clazz == java.lang.Float.class)
        {
            retValue = Float.TYPE;
        }
        return retValue;
    }
1012401
public static boolean isPrimitiveArray(Class<?> clazz) {
		Assert.notNull(clazz, "Class must not be null");
		return (clazz.isArray() && clazz.getComponentType().isPrimitive());
	}
502730
private AbstractManagedType getType(Class clazz, boolean isIdClass)
    {
        if (clazz != null && !clazz.equals(Object.class))
        {
            return processInternal(clazz, isIdClass);
        }
        return null;
    }
269197
public synchronized static TypeDesc forClass(Class<?> clazz) {
        if (clazz == null) {
            return null;
        }

        TypeDesc type = cClassesToInstances.get(clazz);
        if (type != null) {
            return type;
        }

        if (clazz.isArray()) {
            type = forClass(clazz.getComponentType()).toArrayType();
        }
        else if (clazz.isPrimitive()) {
            if (clazz == int.class) {
                type = INT;
            }
            if (clazz == boolean.class) {
                type = BOOLEAN;
            }
            if (clazz == char.class) {
                type = CHAR;
            }
            if (clazz == byte.class) {
                type = BYTE;
            }
            if (clazz == long.class) {
                type = LONG;
            }
            if (clazz == float.class) {
                type = FLOAT;
            }
            if (clazz == double.class) {
                type = DOUBLE;
            }
            if (clazz == short.class) {
                type = SHORT;
            }
            if (clazz == void.class) {
                type = VOID;
            }
        }
        else {
            String name = clazz.getName();
            type = intern(new ObjectType(generateDescriptor(name), name));
        }

        cClassesToInstances.put(clazz, type);
        return type;
    }
17489
public static Class<?> resolveParameterType(MethodParameter methodParam, Class clazz) {
		Type genericType = getTargetType(methodParam);
		Preconditions.checkNotNull(clazz, "Class must not be null");
		Map<TypeVariable, Type> typeVariableMap = getTypeVariableMap(clazz);
		Type rawType = getRawType(genericType, typeVariableMap);
		Class result = (rawType instanceof Class ? (Class) rawType : methodParam.getParameterType());
		methodParam.setParameterType(result);
		methodParam.typeVariableMap = typeVariableMap;
		return result;
	}
306402
public static String getTypeName(Class<?> clazz) {
		Type typeAnnotation = clazz.getAnnotation(Type.class);
		return typeAnnotation != null ? typeAnnotation.value() : null;
	}
569616
public static boolean isProperClass(Class<?> clazz) {
		int mods = clazz.getModifiers();
		return !(Modifier.isAbstract(mods) || Modifier.isInterface(mods) || Modifier.isNative(mods));
	}
990901
public static boolean isNotPojo(Class<?> clazz) throws NullPointerException {
        Assert.notNull(clazz, "clazz不能为null");
        return Boolean.class.isAssignableFrom(clazz) || Character.class.isAssignableFrom(clazz)
               || Number.class.isAssignableFrom(clazz) || Map.class.isAssignableFrom(clazz)
               || String.class.isAssignableFrom(clazz) || Collection.class.isAssignableFrom(clazz)
               || Enum.class.isAssignableFrom(clazz) || isGeneralType(clazz);
    }
1350644
private JClassType findClassType( Class<?> clazz ) {
        JClassType mapperType = context.getTypeOracle().findType( clazz.getCanonicalName() );
        if ( null == mapperType ) {
            logger.log( Type.WARN, "Cannot find the type denoted by the class " + clazz.getCanonicalName()
                       + " or GWT compilation of that class failed. In the latter case, compile with -failOnError to discover the real error." );
            return null;
        }
        return mapperType;
    }
210654
public String getTypeName(Class<?> clazz) {
		Type type = typeAnnotations.get(clazz);

		if (type != null) {
			return type.value();
		}
		return null;
	}
983698
public static Class<?> getRawClass(final Type clazz) {
    if (clazz instanceof Class) {
      return (Class<?>) clazz;
    } else if (clazz instanceof ParameterizedType) {
      return (Class<?>) ((ParameterizedType) clazz).getRawType();
    } else if (clazz instanceof WildcardType) {
      return Object.class; // XXX not really correct, but close enough?
    } else if (clazz instanceof TypeVariable) {
      return Object.class; // XXX not really correct, but close enough?
    } else {
      System.err.println("Can't getRawClass for " + clazz + " of unknown type " + clazz.getClass());
      throw new IllegalArgumentException("Can't getRawClass for " + clazz + " of unknown type " + clazz.getClass());
    }
  }
842384
@SneakyThrows
    public static <T> T deserialize(final InputStream inputStream, final Class<T> clazz) {
        try (val in = new ObjectInputStream(inputStream)) {
            val obj = in.readObject();

            if (!clazz.isAssignableFrom(obj.getClass())) {
                throw new ClassCastException("Result [" + obj
                    + " is of type " + obj.getClass()
                    + " when we were expecting " + clazz);
            }
            return (T) obj;
        }
    }
756877
private FullTypeSignature getTypeSignature(Class<?> clazz) {
		StringBuilder sb = new StringBuilder();
		if (clazz.isArray()) {
			sb.append(clazz.getName());
		} else if (clazz.isPrimitive()) {
			sb.append(primitiveTypesMap.get(clazz).toString());
		} else {
			sb.append('L').append(clazz.getName()).append(';');
		}
		return TypeSignatureFactory.getTypeSignature(sb.toString(), false);

	}
211221
public static Object readPrimitive(Class<?> clazz, String value) throws Exception {
        if (clazz == String.class) {
            return value;
        } else if (clazz == Long.class) {
            return Long.parseLong(value);
        } else if (clazz == Integer.class) {
            return Integer.parseInt(value);
        } else if (clazz == Double.class) {
            return Double.parseDouble(value);
        } else if (clazz == Boolean.class) {
            return Boolean.parseBoolean(value);
        } else if (clazz == Byte.class) {
            return Byte.parseByte(value);
        } else if (clazz == Short.class) {
            return Short.parseShort(value);
        } else if (clazz == Float.class) {
            return Float.parseFloat(value);
        } else {
            throw new Exception("Unsupported primitive: " + clazz); //$NON-NLS-1$
        }
    }