refactor: value null or empty 시 true 반환

This commit is contained in:
dongHyo
2022-05-13 17:07:35 +09:00
parent 7e22abb9dd
commit 64036fa8a6

View File

@@ -11,6 +11,10 @@ public class PhoneValidator implements ConstraintValidator<Phone, String> {
@Override
public boolean isValid(String value, ConstraintValidatorContext context) {
if (value == null || value.isEmpty()) {
return true;
}
return Pattern.matches(PATTERN, value);
}