Class UserDataValidator

java.lang.Object
api.mpba.rastvdmy.service.validator.UserDataValidator

@Component public class UserDataValidator extends Object
A validator class that validates user data fields using different validation strategies.
  • Constructor Details

    • UserDataValidator

      @Autowired public UserDataValidator(CountryValidation countryValidationStrategy)
      Constructor for UserDataValidator.
      Parameters:
      countryValidationStrategy - The strategy for validating country fields.
  • Method Details

    • validateField

      public void validateField(String fieldName, String value) throws ApplicationException
      Validates a specific field using the appropriate validation strategy.
      Parameters:
      fieldName - The name of the field to validate.
      value - The value of the field to validate.
      Throws:
      ApplicationException - if the field is invalid or no validation strategy is found.