Class ObjectValidator<T>
java.lang.Object
org.ntnu.idi.idatt2106.sparesti.sparestibackend.validation.ObjectValidator<T>
- Type Parameters:
T
- The DTO type that class is validating
- Direct Known Subclasses:
ChallengeConfigValidator
,ChallengeValidator
,GoalValidator
,UserValidator
Validator class for DTO objects received from HTTP-requests
Its generic type allows flexibility across DTO's
- Since:
- 24.4.24
- Version:
- 1.0
- Author:
- Harry L.X
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final jakarta.validation.Validator
Validator object used for validation -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkConstraints
(T object) Checks that no field constraints are violated in the objectvoid
Validates the object
-
Field Details
-
validator
protected final jakarta.validation.Validator validatorValidator object used for validation
-
-
Constructor Details
-
ObjectValidator
public ObjectValidator()
-
-
Method Details
-
validate
Validates the object- Parameters:
object
- Object of type T
-
checkConstraints
Checks that no field constraints are violated in the object- Parameters:
object
- The object of type T
-