Package com.hotels.transformer.validator
Class ValidatorImpl
java.lang.Object
com.hotels.transformer.validator.ValidatorImpl
- All Implemented Interfaces:
Validator
public class ValidatorImpl extends Object implements Validator
Java Bean validation class.
It offers the possibility to validate a given Java Bean against a set of defined constraints.
-
Constructor Summary
Constructors Constructor Description ValidatorImpl()
Default constructor. -
Method Summary
Modifier and Type Method Description <K> Set<jakarta.validation.ConstraintViolation<Object>>
getConstraintViolations(K k)
Checks if an object is valid and returns the list of the constraints not met.<K> List<String>
getConstraintViolationsMessages(K k)
Checks if an object is valid and returns the list of the constraints messages not met.<K> void
validate(K k)
Checks if an object is valid.
-
Constructor Details
-
ValidatorImpl
public ValidatorImpl()Default constructor.
-
-
Method Details
-
getConstraintViolations
Checks if an object is valid and returns the list of the constraints not met.- Specified by:
getConstraintViolations
in interfaceValidator
- Type Parameters:
K
- the object class- Parameters:
k
- the object to check- Returns:
- the list of violated constraints.
-
getConstraintViolationsMessages
Checks if an object is valid and returns the list of the constraints messages not met.- Specified by:
getConstraintViolationsMessages
in interfaceValidator
- Type Parameters:
K
- the object class- Parameters:
k
- the object to check- Returns:
- the list of violated constraints messages.
-
validate
public final <K> void validate(K k)Checks if an object is valid.
-