Interface DigitsValidator<T>

  • Type Parameters:
    T - The target type
    All Superinterfaces:
    ConstraintValidator<javax.validation.constraints.Digits,​T>, javax.validation.ConstraintValidator<javax.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<javax.validation.constraints.Digits,​T>
    Abstract Digits validator implementation.
    Since:
    1.2
    • Method Detail

      • isValid

        default boolean isValid​(@Nullable
                                T value,
                                @NonNull
                                io.micronaut.core.annotation.AnnotationValue<javax.validation.constraints.Digits> annotationMetadata,
                                @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<javax.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

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