feat(uapbd): 添加skipNull工具方法新增skipNull静态方法用于处理空值情况,当传入对象为null或空字符串时返回空字符串,
否则返回去除首尾空格的字符串值。该方法可有效避免空指针异常和无效空格问题。
This commit is contained in:
parent
6cc2585572
commit
84207f18d9
|
|
@ -184,4 +184,12 @@ public class MyHelper {
|
||||||
// NCCForUAPLogger.debug(countSql);
|
// NCCForUAPLogger.debug(countSql);
|
||||||
return (Integer) dao.executeQuery(countSql, new ColumnProcessor());
|
return (Integer) dao.executeQuery(countSql, new ColumnProcessor());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String skipNull(Object value) {
|
||||||
|
if ((value == null) || (value.toString().trim().length() == 0)) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return value.toString().trim();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue