StringUtils
字符串工具类,简单的只有valueOf(传入对象返回字符串,trim清除首尾空格),isNull(传入对象,判断非空,转成字符串判断),isNotNull(!isNull).
public class StringUtils { public static String valueOf(Object o) { if (o == null) { return ""; } String os = o.toString().trim(); if ("null".equalsIgnoreCase(os)) { return ""; } return os; } public static boolean isNull(Object o) { if (o == null) { return true; } String vs = valueOf(o); if (vs.trim().isEmpty() || vs.trim().equals("")) { return true; } return false; } public static boolean isNotNull(Object o) { return !isNull(o); } }