判断Field是否是基本类型:
public static boolean isBasicClassType(Field field) {
return field.getType().isPrimitive();
}
判断Field是否是指定的类
public static boolean isTargetClassType(Field field, Class targetType) {
return field.getType() == targetType;
}
网友评论