Class UserDataValidator
java.lang.Object
api.mpba.rastvdmy.service.validator.UserDataValidator
A validator class that validates user data fields using different validation strategies.
-
Constructor Summary
ConstructorDescriptionUserDataValidator
(CountryValidation countryValidationStrategy) Constructor for UserDataValidator. -
Method Summary
Modifier and TypeMethodDescriptionvoid
validateField
(String fieldName, String value) Validates a specific field using the appropriate validation strategy.
-
Constructor Details
-
UserDataValidator
Constructor for UserDataValidator.- Parameters:
countryValidationStrategy
- The strategy for validating country fields.
-
-
Method Details
-
validateField
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.
-