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>

public class ScaledScoreValidator extends DisableableValidator<ScaledScore,Float>
The Float being validated must be a valid scaled score.
Author:
István Rátkai (Selindek)
See Also:
  • Constructor Details

    • ScaledScoreValidator

      public ScaledScoreValidator()
  • Method Details

    • isValidIfEnabled

      public boolean isValidIfEnabled(Float value, jakarta.validation.ConstraintValidatorContext context)
      Description copied from class: DisableableValidator

      Convenient 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 the DisableableValidator.isDisabled() method can be used directly from the ConstraintValidator.isValid(Object, ConstraintValidatorContext) method.
      Overrides:
      isValidIfEnabled in class DisableableValidator<ScaledScore,Float>
      Parameters:
      value - object to validate
      context - context in which the constraint is evaluated
      Returns:
      false if value does not pass the constraint