Package com.skava.validator.services
Class CreateUserValidator
java.lang.Object
com.skava.validator.services.UserValidatorComponent
com.skava.validator.services.CreateUserValidator
- All Implemented Interfaces:
com.skava.core.EcommComponent
,com.skava.core.validation.ValidatorComponent
This class defines create user validator and is used for validating the given request model
UserRequest
.- Author:
- Infosys Equinox
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
preProcess
(@Valid com.skava.core.validation.InputModel model) This pre process method is used to validate the input request model.If the validation fails then it will throw the validation error response will be return as a response with respective http status code, otherwise the main process implementation will execute.Methods inherited from class com.skava.validator.services.UserValidatorComponent
destroy, init, onEvent, postProcess
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.skava.core.validation.ValidatorComponent
preProcess
-
Constructor Details
-
CreateUserValidator
public CreateUserValidator()Default Constructor.
-
-
Method Details
-
preProcess
public void preProcess(@Valid @Valid com.skava.core.validation.InputModel model) This pre process method is used to validate the input request model.If the validation fails then it will throw the validation error response will be return as a response with respective http status code, otherwise the main process implementation will execute.
The following are the validation that occurs- Check whether the collection identifier is valid or not.
- Check whether the users object is present or not.
- Check whether the user mandatory properties like email,phoneNumber,credentials are present or not
- Based on the given email/phoneNumber, check whether the user is duplicated or not.
- Specified by:
preProcess
in interfacecom.skava.core.validation.ValidatorComponent
- Overrides:
preProcess
in classUserValidatorComponent
- Parameters:
model
- ThisInputModel
model holds theUserRequest
request model used for validating the user object and check the mandatory properties.
-