remove hasNull

This commit is contained in:
Looly
2019-11-26 11:52:47 +08:00
parent b6ded332d5
commit 9a4ec7bce2

View File

@@ -117,32 +117,6 @@ public class BeanUtil {
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描述信息
*