Class ScaledScoreValidator
java.lang.Object
dev.learning.xapi.model.validation.disableable.DisableableValidator<ScaledScore,Float>
dev.learning.xapi.model.validation.internal.validators.ScaledScoreValidator
- All Implemented Interfaces:
jakarta.validation.ConstraintValidator<ScaledScore,Float>
The Float being validated must be a valid scaled score.
- Author:
- István Rátkai (Selindek)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisValidIfEnabled(Float 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
-
ScaledScoreValidator
public ScaledScoreValidator()
-
-
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<ScaledScore,Float> - Parameters:
value- object to validatecontext- context in which the constraint is evaluated- Returns:
falseifvaluedoes not pass the constraint
-