Class CheckerBigDecimal
java.lang.Object
util.AbstractChecker<BigDecimal,CheckerBigDecimal>
specialized_checkers.math.numbers.bigTypes.CheckerBigDecimal
- All Implemented Interfaces:
InterfaceCheckerNumber<CheckerBigDecimal>
,InterfaceChecker<AbstractChecker<BigDecimal,
CheckerBigDecimal>, BigDecimal>
public class CheckerBigDecimal
extends AbstractChecker<BigDecimal,CheckerBigDecimal>
implements InterfaceCheckerNumber<CheckerBigDecimal>
Checker for
BigDecimal
instances, providing fluent validation methods for arbitrary-precision decimal numbers.
This class allows you to validate and assert properties of BigDecimal
objects in a fluent and readable way.
-
Field Summary
Fields inherited from class util.AbstractChecker
backObject, exceptionTracker, name, object, saveErrors, stop
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
CheckerBigDecimal
(BigDecimal bigDecimal, String name) Constructs a newCheckerBigDecimal
with the specified bigDecimal and name. -
Method Summary
Modifier and TypeMethodDescriptionstatic CheckerBigDecimal
check
(BigDecimal number) Creates a newCheckerBigDecimal
for the givenBigDecimal
instance with a default name.static CheckerBigDecimal
check
(BigDecimal number, String name) Creates a newCheckerBigDecimal
for the givenBigDecimal
instance with a custom name.isGreaterOrEqualTo
(Byte number) Asserts that theBigDecimal
is greater than or equal to the specifiedByte
value.isGreaterOrEqualTo
(Double number) Asserts that theBigDecimal
is greater than or equal to the specifiedDouble
value.isGreaterOrEqualTo
(Float number) Asserts that theBigDecimal
is greater than or equal to the specifiedFloat
value.isGreaterOrEqualTo
(Integer number) Asserts that theBigDecimal
is greater than or equal to the specifiedInteger
value.isGreaterOrEqualTo
(Long number) Asserts that theBigDecimal
is greater than or equal to the specifiedLong
value.isGreaterOrEqualTo
(Short number) Asserts that theBigDecimal
is greater than or equal to the specifiedShort
value.isGreaterThan
(Byte number) Asserts that theBigDecimal
is greater than the specifiedByte
value.isGreaterThan
(Double number) Asserts that theBigDecimal
is greater than the specifiedDouble
value.isGreaterThan
(Float number) Asserts that theBigDecimal
is greater than the specifiedFloat
value.isGreaterThan
(Integer number) Asserts that theBigDecimal
is greater than the specifiedInteger
value.isGreaterThan
(Long number) Asserts that theBigDecimal
is greater than the specifiedLong
value.isGreaterThan
(Short number) Asserts that theBigDecimal
is greater than the specifiedShort
value.isLessOrEqualTo
(Byte number) Asserts that theBigDecimal
is less than or equal to the specifiedByte
value.isLessOrEqualTo
(Double number) Asserts that theBigDecimal
is less than or equal to the specifiedDouble
value.isLessOrEqualTo
(Float number) Asserts that theBigDecimal
is less than or equal to the specifiedFloat
value.isLessOrEqualTo
(Integer number) Asserts that theBigDecimal
is less than or equal to the specifiedInteger
value.isLessOrEqualTo
(Long number) Asserts that theBigDecimal
is less than or equal to the specifiedLong
value.isLessOrEqualTo
(Short number) Asserts that theBigDecimal
is less than or equal to the specifiedShort
value.isLessThan
(Byte number) Asserts that theBigDecimal
is less than the specifiedByte
value.isLessThan
(Double number) Asserts that theBigDecimal
is less than the specifiedDouble
value.isLessThan
(Float number) Asserts that theBigDecimal
is less than the specifiedFloat
value.isLessThan
(Integer number) Asserts that theBigDecimal
is less than the specifiedInteger
value.isLessThan
(Long number) Asserts that theBigDecimal
is less than the specifiedLong
value.isLessThan
(Short number) Asserts that theBigDecimal
is less than the specifiedShort
value.Asserts that theBigDecimal
is negative (less than zero).Asserts that theBigDecimal
is negative or zero (less than or equal to zero).Asserts that theBigDecimal
is positive (greater than zero).Asserts that theBigDecimal
is positive or zero (greater than or equal to zero).isZero()
Asserts that theBigDecimal
is zero.protected CheckerBigDecimal
self()
Returns this checker instance (for fluent API usage).Methods inherited from class util.AbstractChecker
checkProperty, checkProperty, checkProperty, end, getMethod, getObject, getProperty, hasErrors, hasNotErrors, is, is, isEqual, isNonNull, isNot, isNot, isNull, notSaveErrors, saveErrors, show, showNotThrownException, showThrownException, stop
-
Constructor Details
-
CheckerBigDecimal
Constructs a newCheckerBigDecimal
with the specified bigDecimal and name.- Parameters:
bigDecimal
- theBigDecimal
to be wrapped and checkedname
- the name identifying this checker function
-
-
Method Details
-
check
Creates a newCheckerBigDecimal
for the givenBigDecimal
instance with a custom name.- Parameters:
number
- theBigDecimal
instance to be checkedname
- the name to identify this checker instance (useful for error messages)- Returns:
- a new
CheckerBigDecimal
for the providedBigDecimal
-
check
Creates a newCheckerBigDecimal
for the givenBigDecimal
instance with a default name.- Parameters:
number
- theBigDecimal
instance to be checked- Returns:
- a new
CheckerBigDecimal
for the providedBigDecimal
-
self
Returns this checker instance (for fluent API usage).- Specified by:
self
in classAbstractChecker<BigDecimal,
CheckerBigDecimal> - Returns:
- this
CheckerBigDecimal
instance
-
isPositive
Asserts that theBigDecimal
is positive (greater than zero).- Specified by:
isPositive
in interfaceInterfaceCheckerNumber<CheckerBigDecimal>
- Returns:
- this
CheckerBigDecimal
instance for further validation
-
isPositiveOrZero
Asserts that theBigDecimal
is positive or zero (greater than or equal to zero).- Specified by:
isPositiveOrZero
in interfaceInterfaceCheckerNumber<CheckerBigDecimal>
- Returns:
- this
CheckerBigDecimal
instance for further validation
-
isNegative
Asserts that theBigDecimal
is negative (less than zero).- Specified by:
isNegative
in interfaceInterfaceCheckerNumber<CheckerBigDecimal>
- Returns:
- this
CheckerBigDecimal
instance for further validation
-
isNegativeOrZero
Asserts that theBigDecimal
is negative or zero (less than or equal to zero).- Specified by:
isNegativeOrZero
in interfaceInterfaceCheckerNumber<CheckerBigDecimal>
- Returns:
- this
CheckerBigDecimal
instance for further validation
-
isZero
Asserts that theBigDecimal
is zero.- Specified by:
isZero
in interfaceInterfaceCheckerNumber<CheckerBigDecimal>
- Returns:
- this
CheckerBigDecimal
instance for further validation
-
isGreaterThan
Asserts that theBigDecimal
is greater than the specifiedByte
value.- Specified by:
isGreaterThan
in interfaceInterfaceCheckerNumber<CheckerBigDecimal>
- Parameters:
number
- theByte
value to compare against- Returns:
- this
CheckerBigDecimal
instance for further validation
-
isGreaterThan
Asserts that theBigDecimal
is greater than the specifiedShort
value.- Specified by:
isGreaterThan
in interfaceInterfaceCheckerNumber<CheckerBigDecimal>
- Parameters:
number
- theShort
value to compare against- Returns:
- this
CheckerBigDecimal
instance for further validation
-
isGreaterThan
Asserts that theBigDecimal
is greater than the specifiedInteger
value.- Specified by:
isGreaterThan
in interfaceInterfaceCheckerNumber<CheckerBigDecimal>
- Parameters:
number
- theInteger
value to compare against- Returns:
- this
CheckerBigDecimal
instance for further validation
-
isGreaterThan
Asserts that theBigDecimal
is greater than the specifiedLong
value.- Specified by:
isGreaterThan
in interfaceInterfaceCheckerNumber<CheckerBigDecimal>
- Parameters:
number
- theLong
value to compare against- Returns:
- this
CheckerBigDecimal
instance for further validation
-
isGreaterThan
Asserts that theBigDecimal
is greater than the specifiedFloat
value.- Specified by:
isGreaterThan
in interfaceInterfaceCheckerNumber<CheckerBigDecimal>
- Parameters:
number
- theFloat
value to compare against- Returns:
- this
CheckerBigDecimal
instance for further validation
-
isGreaterThan
Asserts that theBigDecimal
is greater than the specifiedDouble
value.- Specified by:
isGreaterThan
in interfaceInterfaceCheckerNumber<CheckerBigDecimal>
- Parameters:
number
- theDouble
value to compare against- Returns:
- this
CheckerBigDecimal
instance for further validation
-
isGreaterOrEqualTo
Asserts that theBigDecimal
is greater than or equal to the specifiedByte
value.- Specified by:
isGreaterOrEqualTo
in interfaceInterfaceCheckerNumber<CheckerBigDecimal>
- Parameters:
number
- theByte
value to compare against- Returns:
- this
CheckerBigDecimal
instance for further validation
-
isGreaterOrEqualTo
Asserts that theBigDecimal
is greater than or equal to the specifiedShort
value.- Specified by:
isGreaterOrEqualTo
in interfaceInterfaceCheckerNumber<CheckerBigDecimal>
- Parameters:
number
- theShort
value to compare against- Returns:
- this
CheckerBigDecimal
instance for further validation
-
isGreaterOrEqualTo
Asserts that theBigDecimal
is greater than or equal to the specifiedInteger
value.- Specified by:
isGreaterOrEqualTo
in interfaceInterfaceCheckerNumber<CheckerBigDecimal>
- Parameters:
number
- theInteger
value to compare against- Returns:
- this
CheckerBigDecimal
instance for further validation
-
isGreaterOrEqualTo
Asserts that theBigDecimal
is greater than or equal to the specifiedLong
value.- Specified by:
isGreaterOrEqualTo
in interfaceInterfaceCheckerNumber<CheckerBigDecimal>
- Parameters:
number
- theLong
value to compare against- Returns:
- this
CheckerBigDecimal
instance for further validation
-
isGreaterOrEqualTo
Asserts that theBigDecimal
is greater than or equal to the specifiedFloat
value.- Specified by:
isGreaterOrEqualTo
in interfaceInterfaceCheckerNumber<CheckerBigDecimal>
- Parameters:
number
- theFloat
value to compare against- Returns:
- this
CheckerBigDecimal
instance for further validation
-
isGreaterOrEqualTo
Asserts that theBigDecimal
is greater than or equal to the specifiedDouble
value.- Specified by:
isGreaterOrEqualTo
in interfaceInterfaceCheckerNumber<CheckerBigDecimal>
- Parameters:
number
- theDouble
value to compare against- Returns:
- this
CheckerBigDecimal
instance for further validation
-
isLessThan
Asserts that theBigDecimal
is less than the specifiedByte
value.- Specified by:
isLessThan
in interfaceInterfaceCheckerNumber<CheckerBigDecimal>
- Parameters:
number
- theByte
value to compare against- Returns:
- this
CheckerBigDecimal
instance for further validation
-
isLessThan
Asserts that theBigDecimal
is less than the specifiedShort
value.- Specified by:
isLessThan
in interfaceInterfaceCheckerNumber<CheckerBigDecimal>
- Parameters:
number
- theShort
value to compare against- Returns:
- this
CheckerBigDecimal
instance for further validation
-
isLessThan
Asserts that theBigDecimal
is less than the specifiedInteger
value.- Specified by:
isLessThan
in interfaceInterfaceCheckerNumber<CheckerBigDecimal>
- Parameters:
number
- theInteger
value to compare against- Returns:
- this
CheckerBigDecimal
instance for further validation
-
isLessThan
Asserts that theBigDecimal
is less than the specifiedLong
value.- Specified by:
isLessThan
in interfaceInterfaceCheckerNumber<CheckerBigDecimal>
- Parameters:
number
- theLong
value to compare against- Returns:
- this
CheckerBigDecimal
instance for further validation
-
isLessThan
Asserts that theBigDecimal
is less than the specifiedFloat
value.- Specified by:
isLessThan
in interfaceInterfaceCheckerNumber<CheckerBigDecimal>
- Parameters:
number
- theFloat
value to compare against- Returns:
- this
CheckerBigDecimal
instance for further validation
-
isLessThan
Asserts that theBigDecimal
is less than the specifiedDouble
value.- Specified by:
isLessThan
in interfaceInterfaceCheckerNumber<CheckerBigDecimal>
- Parameters:
number
- theDouble
value to compare against- Returns:
- this
CheckerBigDecimal
instance for further validation
-
isLessOrEqualTo
Asserts that theBigDecimal
is less than or equal to the specifiedByte
value.- Specified by:
isLessOrEqualTo
in interfaceInterfaceCheckerNumber<CheckerBigDecimal>
- Parameters:
number
- theByte
value to compare against- Returns:
- this
CheckerBigDecimal
instance for further validation
-
isLessOrEqualTo
Asserts that theBigDecimal
is less than or equal to the specifiedShort
value.- Specified by:
isLessOrEqualTo
in interfaceInterfaceCheckerNumber<CheckerBigDecimal>
- Parameters:
number
- theShort
value to compare against- Returns:
- this
CheckerBigDecimal
instance for further validation
-
isLessOrEqualTo
Asserts that theBigDecimal
is less than or equal to the specifiedInteger
value.- Specified by:
isLessOrEqualTo
in interfaceInterfaceCheckerNumber<CheckerBigDecimal>
- Parameters:
number
- theInteger
value to compare against- Returns:
- this
CheckerBigDecimal
instance for further validation
-
isLessOrEqualTo
Asserts that theBigDecimal
is less than or equal to the specifiedLong
value.- Specified by:
isLessOrEqualTo
in interfaceInterfaceCheckerNumber<CheckerBigDecimal>
- Parameters:
number
- theLong
value to compare against- Returns:
- this
CheckerBigDecimal
instance for further validation
-
isLessOrEqualTo
Asserts that theBigDecimal
is less than or equal to the specifiedFloat
value.- Specified by:
isLessOrEqualTo
in interfaceInterfaceCheckerNumber<CheckerBigDecimal>
- Parameters:
number
- theFloat
value to compare against- Returns:
- this
CheckerBigDecimal
instance for further validation
-
isLessOrEqualTo
Asserts that theBigDecimal
is less than or equal to the specifiedDouble
value.- Specified by:
isLessOrEqualTo
in interfaceInterfaceCheckerNumber<CheckerBigDecimal>
- Parameters:
number
- theDouble
value to compare against- Returns:
- this
CheckerBigDecimal
instance for further validation
-