refactor: value null or empty 시 true 반환
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user