字符串判空
public static void testArgsNull(Object arg,String msg){ if(isEmpty(arg)){ throw new RuntimeException(msg); } } public static boolean isEmpty(Object o){ if(o==null){return true;} if( "".equals(o) || "null".equalsIgnoreCase(o.toString()) || o.toString().trim().length()==0 ){ return true; } return false; }