Class PhoneNumberValidator
java.lang.Object
com.helixframework.validation.phone.PhoneNumberValidator
- All Implemented Interfaces:
jakarta.validation.ConstraintValidator<PhoneNumber,String>
public class PhoneNumberValidator
extends Object
implements jakarta.validation.ConstraintValidator<PhoneNumber,String>
Validates phone numbers annotated with
PhoneNumber.
Ensures that the phone number is valid according to the E.164 standard.
This validator uses the Google libphonenumber library to parse and validate
phone numbers. If the provided phone number is null or blank, it is considered valid
(to allow other validations like @NotEmpty if required). Otherwise, the phone number
will be parsed and checked for validity.-
Constructor Details
-
PhoneNumberValidator
public PhoneNumberValidator()
-
-
Method Details
-
isValid
- Specified by:
isValidin interfacejakarta.validation.ConstraintValidator<PhoneNumber,String>
-