- java.lang.Object
-
- io.rxmicro.validation.validator.NumericConstraintValidator
-
- All Implemented Interfaces:
ConstraintValidator<BigDecimal>
public class NumericConstraintValidator extends Object implements ConstraintValidator<BigDecimal>
Validator for theNumericconstraint.- Since:
- 0.1
- Author:
- nedis
- See Also:
Numeric
-
-
Constructor Summary
Constructors Constructor Description NumericConstraintValidator(int expectedPrecision, int expectedScale)Creates the default instance ofNumericConstraintValidatorwith the specified precision and scale.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidvalidate(BigDecimal actual, HttpModelType httpModelType, String modelName)Validates the single actual.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.rxmicro.validation.ConstraintValidator
validate, validateList, validateList
-
-
-
-
Constructor Detail
-
NumericConstraintValidator
public NumericConstraintValidator(int expectedPrecision, int expectedScale)Creates the default instance ofNumericConstraintValidatorwith the specified precision and scale.- Parameters:
expectedPrecision- the specified precisionexpectedScale- the specified scale
-
-
Method Detail
-
validate
public void validate(BigDecimal actual, HttpModelType httpModelType, String modelName)
Description copied from interface:ConstraintValidatorValidates the single actual.The state of the
actualmust not be altered.- Specified by:
validatein interfaceConstraintValidator<BigDecimal>- Parameters:
actual- the actual value to validatehttpModelType- the http model typemodelName- the parameter or header name
-
-