非空判断方法

@SuppressWarnings("rawtypes")
protected boolean isNull(Object o) {
if (o == null)
return true;
boolean isNull = true;
if (o instanceof List) {
List t = (List) o;
if (t != null && !t.isEmpty())
isNull = false;
} else if (o instanceof String) {
String t = (String) o;
if (!t.trim().equals("") && !t.equals("undefined") && !t.equals("null"))
isNull = false;
} else {
return o == null;
}
return isNull;
}

猜你喜欢

转载自blog.csdn.net/u012310865/article/details/79694445