Class NewPasswordDtoValidator
java.lang.Object
com.app.validate.NewPasswordDtoValidator
- All Implemented Interfaces:
Validator<NewPasswordDto>
Validator implementation for NewPasswordDto objects.
Validates the new password and confirm password fields according to configured password rules.
-
Constructor Summary
ConstructorsConstructorDescriptionNewPasswordDtoValidator
(List<String> passwordRegexs, int minLength) Constructs a NewPasswordDtoValidator with the given password validation parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoid
validate
(NewPasswordDto newPasswordDto) Validates the given NewPasswordDto object.
-
Constructor Details
-
NewPasswordDtoValidator
public NewPasswordDtoValidator(@Value("${validate.regex.password}") List<String> passwordRegexs, @Value("${validate.password.min.length}") int minLength) Constructs a NewPasswordDtoValidator with the given password validation parameters.- Parameters:
passwordRegexs
- list of regex patterns to validate password complexityminLength
- minimum length required for the password
-
-
Method Details
-
validate
Validates the given NewPasswordDto object. Checks for null input and validates the new password and confirm password fields. Collects errors and throws ValidationException if validation fails.- Specified by:
validate
in interfaceValidator<NewPasswordDto>
- Parameters:
newPasswordDto
- the NewPasswordDto object to validate- Throws:
ValidationException
- if any validation errors occur
-