Ejemplo n.º 1
0
 private boolean setUsername(String username, UsrAccount account) {
   boolean isEmail = emailValidator.isValid(username, null);
   if (isEmail) {
     account.setEmail(username);
     return true;
   }
   boolean isQQ =
       StringUtils.isNumeric(username) && (username.length() >= 5 && username.length() <= 10);
   if (isQQ) {
     account.setQq(username);
     return true;
   }
   boolean isTel = StringUtils.isNumeric(username) && (username.length() == 11);
   if (isTel) {
     account.setTel(username);
     return true;
   }
   return false;
 }