Class NewPasswordDtoValidator

java.lang.Object
com.app.validate.NewPasswordDtoValidator
All Implemented Interfaces:
Validator<NewPasswordDto>

@Component public class NewPasswordDtoValidator extends Object implements Validator<NewPasswordDto>
Validator implementation for NewPasswordDto objects. Validates the new password and confirm password fields according to configured password rules.
  • 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 complexity
      minLength - minimum length required for the password
  • Method Details

    • validate

      public void validate(NewPasswordDto newPasswordDto)
      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 interface Validator<NewPasswordDto>
      Parameters:
      newPasswordDto - the NewPasswordDto object to validate
      Throws:
      ValidationException - if any validation errors occur