public class StringUtil { public static boolean isNotNull(String str){ return !isNull(str); } public static boolean isNull(String str){ if(str == null || str.trim().isEmpty()) return true; return false; } public static boolean isNumber(String str) { try{ new BigDecimal(str); return true; }catch (NumberFormatException e) { return false; } } // format time public static String formatTime(Time time,String formatter) { if(time!=null) { Date date = time.getCalendar().getTime(); return new SimpleDateFormat(formatter).format(date); } return ""; } }