- java.lang.Object
-
- io.rxmicro.validation.validator.PhoneConstraintValidator
-
- All Implemented Interfaces:
ConstraintValidator<String>
- Direct Known Subclasses:
TelegramConstraintValidator,ViberConstraintValidator,WhatsAppConstraintValidator
public class PhoneConstraintValidator extends Object implements ConstraintValidator<String>
Validator for thePhoneconstraint.Read more: https://en.wikipedia.org/wiki/National_conventions_for_writing_telephone_numbers
- Since:
- 0.1
- Author:
- nedis
- See Also:
Phone
-
-
Constructor Summary
Constructors Constructor Description PhoneConstraintValidator(boolean withoutPlus, boolean allowsSpaces)Creates the default instance ofPhoneConstraintValidatorwith the specified parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidvalidate(String actual, HttpModelType httpModelType, String modelName)Validates the single actual.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.rxmicro.validation.ConstraintValidator
validate, validateList, validateList
-
-
-
-
Constructor Detail
-
PhoneConstraintValidator
public PhoneConstraintValidator(boolean withoutPlus, boolean allowsSpaces)Creates the default instance ofPhoneConstraintValidatorwith the specified parameters.- Parameters:
withoutPlus- value must be without plus or notallowsSpaces- allows whitespaces or not
-
-
Method Detail
-
validate
public void validate(String actual, HttpModelType httpModelType, String modelName)
Description copied from interface:ConstraintValidatorValidates the single actual.The state of the
actualmust not be altered.- Specified by:
validatein interfaceConstraintValidator<String>- Parameters:
actual- the actual value to validatehttpModelType- the http model typemodelName- the parameter or header name
-
-