字符串参数判空

  字符串判空

    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;
    }
原文地址:https://www.cnblogs.com/qq376324789/p/12216708.html