Class DateOfBirthValidation
java.lang.Object
api.mpba.rastvdmy.service.validator.DateOfBirthValidation
- All Implemented Interfaces:
ValidationStrategy
Validates the date of birth for a user.
Ensures the date of birth is not null or empty, matches the required format,
is a valid date, is not in the future, and the age is between 18 and 100 years.
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
DateOfBirthValidation
public DateOfBirthValidation()
-
-
Method Details
-
validate
Validates the given date of birth.- Specified by:
validate
in interfaceValidationStrategy
- Parameters:
dateOfBirth
- the date of birth to validate- Throws:
ApplicationException
- if the date of birth is invalid
-