Create util method to check if email is empty

- Create method to check if email is empty or the default AuthMe email (avoids repetition)
- Check that input email has '@' inside text (relates to #1105)
This commit is contained in:
ljacqu
2017-04-18 21:24:33 +02:00
parent b99cc3bada
commit b0c05afaa7
9 changed files with 40 additions and 14 deletions
@@ -88,4 +88,14 @@ public final class Utils {
return Runtime.getRuntime().availableProcessors();
}
/**
* Returns whether the given email is empty or equal to the standard "undefined" email address.
*
* @param email the email to check
*
* @return true if the email is empty
*/
public static boolean isEmailEmpty(String email) {
return StringUtils.isEmpty(email) || "your@email.com".equalsIgnoreCase(email);
}
}