扁平化色块风格的网站,固定ip如何做网站服务器,想做网站濮阳网站建设,网页设计入门问题和解决办法根据type类型判断是否为基本数据类型#xff0c;或基本数据类型的包装类#xff0c;或泛型为基本数据类型 /*** 判断是否为基本数据类型#xff0c;或基本数据类型的包装类#xff0c;或泛型为基本数据类型* string true* int true* Integer true* String[] true* user[] …根据type类型判断是否为基本数据类型或基本数据类型的包装类或泛型为基本数据类型 /*** 判断是否为基本数据类型或基本数据类型的包装类或泛型为基本数据类型* string true* int true* Integer true* String[] true* user[] false* Liststring true* listuser false* MapString,User false*/private static boolean isPrimitive(Type parameterType) {Class? clazz TypeUtil.getClass(parameterType);if (clazz.equals(String.class) || ClassUtil.isBasicType(clazz)) {return true;}if ((clazz.isArray() ClassUtil.isSimpleValueType(clazz.getComponentType()))) {return true;}if (parameterType instanceof ParameterizedType) {Type[] t ((ParameterizedType) parameterType).getActualTypeArguments();for (Type p : t) {if (isPrimitive(p)) {return true;}}}return false;}