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 com.github.cowwoc.requirements10.java.validator.component.ComparableComponent
isBetween, isBetween, isGreaterThan, isGreaterThan, isGreaterThanOrEqualTo, isGreaterThanOrEqualTo, isLessThan, isLessThan, isLessThanOrEqualTo, isLessThanOrEqualTo
Methods declared in interface com.github.cowwoc.requirements10.java.validator.component.DecimalNumberComponent
isNotWholeNumber, isWholeNumber
Methods declared in interface com.github.cowwoc.requirements10.java.validator.component.NegativeNumberComponent
isNegative, isNotNegative
Methods declared in interface com.github.cowwoc.requirements10.java.validator.component.ObjectComponent
getValue, isEqualTo, isEqualTo, isInstanceOf, isInstanceOf, isNotEqualTo, isNotEqualTo, isNotInstanceOf, isNotInstanceOf, isNotNull, isNull, isReferenceEqualTo, isReferenceNotEqualTo
Methods declared in interface com.github.cowwoc.requirements10.java.validator.component.PositiveNumberComponent
isNotPositive, isPositive
Methods declared in interface com.github.cowwoc.requirements10.java.validator.component.ValidatorComponent
and, elseGetFailures, elseThrow, getContext, getContextAsString, getName, getValueOrDefault, validationFailed, withContext
Methods declared in interface com.github.cowwoc.requirements10.java.validator.component.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 orfactor
are 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:name
is emptyname
contains whitespacename
is 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 orfactor
are 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:name
is emptyname
contains whitespacename
is 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
-