StringUtil

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 "";
	}
	
}

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327037346&siteId=291194637