mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
remove hasNull
This commit is contained in:
@@ -117,32 +117,6 @@ public class BeanUtil {
|
|||||||
return PropertyEditorManager.findEditor(type);
|
return PropertyEditorManager.findEditor(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 判断Bean中是否有值为null的字段
|
|
||||||
*
|
|
||||||
* @param bean Bean
|
|
||||||
* @return 是否有值为null的字段
|
|
||||||
* @deprecated 请使用{@link #hasNullField(Object)}
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public static boolean hasNull(Object bean) {
|
|
||||||
final Field[] fields = ClassUtil.getDeclaredFields(bean.getClass());
|
|
||||||
|
|
||||||
Object fieldValue = null;
|
|
||||||
for (Field field : fields) {
|
|
||||||
field.setAccessible(true);
|
|
||||||
try {
|
|
||||||
fieldValue = field.get(bean);
|
|
||||||
} catch (Exception e) {
|
|
||||||
//ignore
|
|
||||||
}
|
|
||||||
if (null == fieldValue) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取{@link BeanDesc} Bean描述信息
|
* 获取{@link BeanDesc} Bean描述信息
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user