Created
November 3, 2021 11:36
-
-
Save alexchirea/c53d70dd580d8a37d8c023639d549824 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomGoogleEmailValidator implements ConstraintValidator<CustomGoogleEmailConstraint, String> { | |
@Override | |
public void initialize(CustomGoogleEmailConstraint email) { } | |
@Override | |
public boolean isValid(String email, ConstraintValidatorContext constraintValidatorContext) { | |
return email != null && email.matches("^[a-zA-Z0–9.]+@gmail.com"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment