class EmailValidator implements ConstraintValidator<Email, String> {

    public boolean isValid(String value, ConstraintValidatorContext context) {
        return Strings.nullToEmpty(value).matches(EMAIL_PATTERN);
    }

}