Class ScoreValidator
java.lang.Object
dev.learning.xapi.model.validation.disableable.DisableableValidator<VaildScore,Score>
dev.learning.xapi.model.validation.internal.validators.ScoreValidator
- All Implemented Interfaces:
jakarta.validation.ConstraintValidator<VaildScore,Score>
The raw score must be greater or equal to min and less or equal to max.
- Author:
- István Rátkai (Selindek)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisValidIfEnabled(Score value, jakarta.validation.ConstraintValidatorContext context) Convenient method for implementing the validation logic independently from the disabled/enabled logic.Methods inherited from class dev.learning.xapi.model.validation.disableable.DisableableValidator
isDisabled, isValidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.validation.ConstraintValidator
initialize
-
Constructor Details
-
ScoreValidator
public ScoreValidator()
-
-
Method Details
-
isValidIfEnabled
Description copied from class:DisableableValidatorConvenient method for implementing the validation logic independently from the disabled/enabled logic.
If some more complex validation logic is needed (eg. some partial validation is needed even if the validator is disabled), then theDisableableValidator.isDisabled()method can be used directly from theConstraintValidator.isValid(Object, ConstraintValidatorContext)method.- Overrides:
isValidIfEnabledin classDisableableValidator<VaildScore,Score> - Parameters:
value- object to validatecontext- context in which the constraint is evaluated- Returns:
falseifvaluedoes not pass the constraint
-