Interface DigitsValidator<T>

Type Parameters:
T - The target type
All Superinterfaces:
ConstraintValidator<jakarta.validation.constraints.Digits,T>, jakarta.validation.ConstraintValidator<jakarta.validation.constraints.Digits,T>
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface DigitsValidator<T> extends ConstraintValidator<jakarta.validation.constraints.Digits,T>
Abstract Digits validator implementation.
Since:
1.2
Author:
graemerocher
  • Field Summary

    Fields inherited from interface io.micronaut.validation.validator.constraints.ConstraintValidator

    VALID
  • Method Summary

    Modifier and Type
    Method
    Description
    Resolve a big decimal for the given value.
    default boolean
    isValid(T value, @NonNull io.micronaut.core.annotation.AnnotationValue<jakarta.validation.constraints.Digits> annotationMetadata, @NonNull ConstraintValidatorContext context)
    Implements the validation logic.

    Methods inherited from interface io.micronaut.validation.validator.constraints.ConstraintValidator

    isValid

    Methods inherited from interface jakarta.validation.ConstraintValidator

    initialize
  • Method Details

    • isValid

      default boolean isValid(@Nullable T value, @NonNull @NonNull io.micronaut.core.annotation.AnnotationValue<jakarta.validation.constraints.Digits> annotationMetadata, @NonNull @NonNull ConstraintValidatorContext context)
      Description copied from interface: ConstraintValidator
      Implements the validation logic.

      Implementations should be thread-safe and immutable.

      Specified by:
      isValid in interface ConstraintValidator<jakarta.validation.constraints.Digits,T>
      Parameters:
      value - object to validate
      annotationMetadata - The annotation metadata
      context - The context object
      Returns:
      false if value does not pass the constraint
    • getBigDecimal

      BigDecimal getBigDecimal(@NonNull T value)
      Resolve a big decimal for the given value.
      Parameters:
      value - The value
      Returns:
      The big decimal