T
- The target type@FunctionalInterface public interface DigitsValidator<T> extends ConstraintValidator<Digits,T>
Digits
validator implementation.VALID
Modifier and Type | Method and Description |
---|---|
BigDecimal |
getBigDecimal(T value)
Resolve a big decimal for the given value.
|
default boolean |
isValid(T value,
AnnotationValue<Digits> annotationMetadata,
ConstraintValidatorContext context)
Implements the validation logic.
|
isValid
initialize
default boolean isValid(@Nullable T value, @NonNull AnnotationValue<Digits> annotationMetadata, @NonNull ConstraintValidatorContext context)
ConstraintValidator
Implementations should be thread-safe and immutable.
value
- object to validateannotationMetadata
- The annotation metadatacontext
- The context objectfalse
if value
does not pass the constraintBigDecimal getBigDecimal(@NonNull T value)
value
- The value