验证对象是否为空的工具类
public static String fmtStringEmpty(Object obj) {
String fmtStr = "";
if (obj == null) {
return fmtStr;
} else {
if (obj instanceof Date) {
fmtStr = String.valueOf(obj);
if (fmtStr.length() > 0) {
fmtStr = fmtStr.substring(0, 19);
}
} else {
fmtStr = String.valueOf(obj);
if("null".equalsIgnoreCase(fmtStr)){
fmtStr = "";
}
}
return fmtStr;
}
}