Interface BigDecimalValidator
- All Superinterfaces:
ComparableComponent<BigDecimalValidator, BigDecimal>, DecimalNumberComponent<BigDecimalValidator>, NegativeNumberComponent<BigDecimalValidator>, ObjectComponent<BigDecimalValidator, BigDecimal>, PositiveNumberComponent<BigDecimalValidator>, ValidatorComponent<BigDecimalValidator, BigDecimal>, ZeroNumberComponent<BigDecimalValidator>
public interface BigDecimalValidator
extends ValidatorComponent<BigDecimalValidator, BigDecimal>, ObjectComponent<BigDecimalValidator, BigDecimal>, NegativeNumberComponent<BigDecimalValidator>, PositiveNumberComponent<BigDecimalValidator>, ZeroNumberComponent<BigDecimalValidator>, ComparableComponent<BigDecimalValidator, BigDecimal>, DecimalNumberComponent<BigDecimalValidator>
Validates the state of a
BigDecimal.-
Method Summary
Modifier and TypeMethodDescriptionisMultipleOf(BigDecimal factor) Ensures that the value is a multiple offactor.isMultipleOf(BigDecimal factor, String name) Ensures that the value is a multiple offactor.isNotMultipleOf(BigDecimal factor) Ensures that the value is not a multiple offactor.isNotMultipleOf(BigDecimal factor, String name) Ensures that the value is not a multiple offactor.Returns a validator forBigDecimal.precision().scale()Returns a validator forBigDecimal.scale().Methods declared in interface ComparableComponent
isBetween, isBetween, isGreaterThan, isGreaterThan, isGreaterThanOrEqualTo, isGreaterThanOrEqualTo, isLessThan, isLessThan, isLessThanOrEqualTo, isLessThanOrEqualToMethods declared in interface DecimalNumberComponent
isNotWholeNumber, isWholeNumberMethods declared in interface NegativeNumberComponent
isNegative, isNotNegativeMethods declared in interface ObjectComponent
getValue, isEqualTo, isEqualTo, isInstanceOf, isInstanceOf, isNotEqualTo, isNotEqualTo, isNotInstanceOf, isNotInstanceOf, isNotNull, isNull, isReferenceEqualTo, isReferenceNotEqualToMethods declared in interface PositiveNumberComponent
isNotPositive, isPositiveMethods declared in interface ValidatorComponent
and, elseGetFailures, elseThrow, getContext, getContextAsString, getName, getValueOrDefault, validationFailed, withContextMethods declared in interface ZeroNumberComponent
isNotZero, isZero
-
Method Details
-
isMultipleOf
Ensures that the value is a multiple offactor.- Parameters:
factor- the number being multiplied- Returns:
- this
- Throws:
NullPointerException- if the value orfactorare nullIllegalArgumentException- if the value is not a multiple offactor
-
isMultipleOf
Ensures that the value is a multiple offactor.- Parameters:
factor- the number being multipliedname- the name of the factor- Returns:
- this
- Throws:
NullPointerException- if the value or any of the arguments are nullIllegalArgumentException- if:nameis emptynamecontains whitespacenameis already in use by the value being validated or the validator context- the value is not a multiple of
factor
-
isNotMultipleOf
Ensures that the value is not a multiple offactor.- Parameters:
factor- the number being multiplied- Returns:
- this
- Throws:
NullPointerException- if the value orfactorare nullIllegalArgumentException- if the value is a multiple offactor
-
isNotMultipleOf
Ensures that the value is not a multiple offactor.- Parameters:
factor- the number being multipliedname- the name of the factor- Returns:
- this
- Throws:
NullPointerException- if the value or any of the arguments are nullIllegalArgumentException- if:nameis emptynamecontains whitespacenameis already in use by the value being validated or the validator context- the value is a multiple of
factor
-
precision
PrimitiveUnsignedIntegerValidator precision()Returns a validator forBigDecimal.precision().- Returns:
- a validator for
BigDecimal.precision() - Throws:
NullPointerException- if the value is null
-
scale
PrimitiveIntegerValidator scale()Returns a validator forBigDecimal.scale().- Returns:
- a validator for
BigDecimal.scale() - Throws:
NullPointerException- if the value is null
-