Class CheckerLong
- All Implemented Interfaces:
InterfaceCheckerNumber<CheckerLong>
,InterfaceChecker<AbstractChecker<Long,
CheckerLong>, Long>
public class CheckerLong
extends AbstractChecker<Long,CheckerLong>
implements InterfaceCheckerNumber<CheckerLong>
Checker for
Long
instances, providing fluent validation methods for long integer numbers.
This class allows you to validate and assert properties of Long
objects in a fluent and readable way.
-
Field Summary
Fields inherited from class util.AbstractChecker
backObject, exceptionTracker, name, object, saveErrors, stop
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
CheckerLong
(Long nLong, String name) Constructs a newCheckerLong
with the specified nLong and name. -
Method Summary
Modifier and TypeMethodDescriptionstatic CheckerLong
Creates a newCheckerLong
for the givenLong
instance with a default name.static CheckerLong
Creates a newCheckerLong
for the givenLong
instance with a custom name.static CheckerLong
Creates a newCheckerLong
for the givenNumber
instance with a default name.static CheckerLong
Creates a newCheckerLong
for the givenNumber
instance with a custom name.isEven()
Asserts that theLong
value is even (divisible by two).isGreaterOrEqualTo
(Byte number) Asserts that theLong
value is greater than or equal to the specifiedByte
value.isGreaterOrEqualTo
(Double number) Asserts that theLong
value is greater than or equal to the specifiedDouble
value.isGreaterOrEqualTo
(Float number) Asserts that theLong
value is greater than or equal to the specifiedFloat
value.isGreaterOrEqualTo
(Integer number) Asserts that theLong
value is greater than or equal to the specifiedInteger
value.isGreaterOrEqualTo
(Long number) Asserts that theLong
value is greater than or equal to the specifiedLong
value.isGreaterOrEqualTo
(Short number) Asserts that theLong
value is greater than or equal to the specifiedShort
value.isGreaterThan
(Byte number) Asserts that theLong
value is greater than the specified value.isGreaterThan
(Double number) Asserts that theLong
value is greater than the specifiedDouble
value.isGreaterThan
(Float number) Asserts that theLong
value is greater than the specifiedFloat
value.isGreaterThan
(Integer number) Asserts that theLong
value is less than the specified value.isGreaterThan
(Long number) Asserts that theLong
value is less than or equal to the specified value.isGreaterThan
(Short number) Asserts that theLong
value is greater than or equal to the specified value.isLessOrEqualTo
(Byte number) Asserts that theLong
value is less than or equal to the specifiedByte
value.isLessOrEqualTo
(Double number) Asserts that theLong
value is less than or equal to the specifiedDouble
value.isLessOrEqualTo
(Float number) Asserts that theLong
value is less than or equal to the specifiedFloat
value.isLessOrEqualTo
(Integer number) Asserts that theLong
value is less than or equal to the specifiedInteger
value.isLessOrEqualTo
(Long number) Asserts that theLong
value is less than or equal to the specifiedLong
value.isLessOrEqualTo
(Short number) Asserts that theLong
value is less than or equal to the specifiedShort
value.isLessThan
(Byte number) Asserts that theLong
value is less than the specifiedByte
value.isLessThan
(Double number) Asserts that theLong
value is less than the specifiedDouble
value.isLessThan
(Float number) Asserts that theLong
value is less than the specifiedFloat
value.isLessThan
(Integer number) Asserts that theLong
value is less than the specifiedInteger
value.isLessThan
(Long number) Asserts that theLong
value is less than the specifiedLong
value.isLessThan
(Short number) Asserts that theLong
value is less than the specifiedShort
value.Asserts that theLong
value is negative (less than zero).Asserts that theLong
value is negative or zero (less than or equal to zero).isOdd()
Asserts that theLong
value is odd (not divisible by two).Asserts that theLong
value is positive (greater than zero).Asserts that theLong
value is positive or zero (greater than or equal to zero).isPrime()
Asserts that theLong
value is prime.isZero()
Asserts that theLong
value is zero.protected CheckerLong
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
-
CheckerLong
-
-
Method Details
-
check
Creates a newCheckerLong
for the givenLong
instance with a custom name.- Parameters:
number
- theLong
instance to be checkedname
- the name to identify this checker instance (useful for error messages)- Returns:
- a new
CheckerLong
for the providedLong
-
check
Creates a newCheckerLong
for the givenNumber
instance with a custom name.- Parameters:
number
- theNumber
instance to be checked (converted to long)name
- the name to identify this checker instance (useful for error messages)- Returns:
- a new
CheckerLong
for the providedNumber
-
check
Creates a newCheckerLong
for the givenLong
instance with a default name.- Parameters:
number
- theLong
instance to be checked- Returns:
- a new
CheckerLong
for the providedLong
-
check
Creates a newCheckerLong
for the givenNumber
instance with a default name.- Parameters:
number
- theNumber
instance to be checked (converted to long)- Returns:
- a new
CheckerLong
for the providedNumber
-
self
Returns this checker instance (for fluent API usage).- Specified by:
self
in classAbstractChecker<Long,
CheckerLong> - Returns:
- this
CheckerLong
instance
-
isEven
Asserts that theLong
value is even (divisible by two).- Returns:
- this
CheckerLong
instance for further validation
-
isOdd
Asserts that theLong
value is odd (not divisible by two).- Returns:
- this
CheckerLong
instance for further validation
-
isPrime
Asserts that theLong
value is prime.- Returns:
- this
CheckerLong
instance for further validation
-
isPositive
Asserts that theLong
value is positive (greater than zero).- Specified by:
isPositive
in interfaceInterfaceCheckerNumber<CheckerLong>
- Returns:
- this
CheckerLong
instance for further validation
-
isPositiveOrZero
Asserts that theLong
value is positive or zero (greater than or equal to zero).- Specified by:
isPositiveOrZero
in interfaceInterfaceCheckerNumber<CheckerLong>
- Returns:
- this
CheckerLong
instance for further validation
-
isNegative
Asserts that theLong
value is negative (less than zero).- Specified by:
isNegative
in interfaceInterfaceCheckerNumber<CheckerLong>
- Returns:
- this
CheckerLong
instance for further validation
-
isNegativeOrZero
Asserts that theLong
value is negative or zero (less than or equal to zero).- Specified by:
isNegativeOrZero
in interfaceInterfaceCheckerNumber<CheckerLong>
- Returns:
- this
CheckerLong
instance for further validation
-
isZero
Asserts that theLong
value is zero.- Specified by:
isZero
in interfaceInterfaceCheckerNumber<CheckerLong>
- Returns:
- this
CheckerLong
instance for further validation
-
isGreaterThan
Asserts that theLong
value is greater than the specified value.- Specified by:
isGreaterThan
in interfaceInterfaceCheckerNumber<CheckerLong>
- Parameters:
number
- the value to compare against- Returns:
- this
CheckerLong
instance for further validation
-
isGreaterThan
Asserts that theLong
value is greater than or equal to the specified value.- Specified by:
isGreaterThan
in interfaceInterfaceCheckerNumber<CheckerLong>
- Parameters:
number
- the value to compare against- Returns:
- this
CheckerLong
instance for further validation
-
isGreaterThan
Asserts that theLong
value is less than the specified value.- Specified by:
isGreaterThan
in interfaceInterfaceCheckerNumber<CheckerLong>
- Parameters:
number
- the value to compare against- Returns:
- this
CheckerLong
instance for further validation
-
isGreaterThan
Asserts that theLong
value is less than or equal to the specified value.- Specified by:
isGreaterThan
in interfaceInterfaceCheckerNumber<CheckerLong>
- Parameters:
number
- the value to compare against- Returns:
- this
CheckerLong
instance for further validation
-
isGreaterThan
Asserts that theLong
value is greater than the specifiedFloat
value.- Specified by:
isGreaterThan
in interfaceInterfaceCheckerNumber<CheckerLong>
- Parameters:
number
- theFloat
value to compare against- Returns:
- this
CheckerLong
instance for further validation
-
isGreaterThan
Asserts that theLong
value is greater than the specifiedDouble
value.- Specified by:
isGreaterThan
in interfaceInterfaceCheckerNumber<CheckerLong>
- Parameters:
number
- theDouble
value to compare against- Returns:
- this
CheckerLong
instance for further validation
-
isGreaterOrEqualTo
Asserts that theLong
value is greater than or equal to the specifiedByte
value.- Specified by:
isGreaterOrEqualTo
in interfaceInterfaceCheckerNumber<CheckerLong>
- Parameters:
number
- theByte
value to compare against- Returns:
- this
CheckerLong
instance for further validation
-
isGreaterOrEqualTo
Asserts that theLong
value is greater than or equal to the specifiedShort
value.- Specified by:
isGreaterOrEqualTo
in interfaceInterfaceCheckerNumber<CheckerLong>
- Parameters:
number
- theShort
value to compare against- Returns:
- this
CheckerLong
instance for further validation
-
isGreaterOrEqualTo
Asserts that theLong
value is greater than or equal to the specifiedInteger
value.- Specified by:
isGreaterOrEqualTo
in interfaceInterfaceCheckerNumber<CheckerLong>
- Parameters:
number
- theInteger
value to compare against- Returns:
- this
CheckerLong
instance for further validation
-
isGreaterOrEqualTo
Asserts that theLong
value is greater than or equal to the specifiedLong
value.- Specified by:
isGreaterOrEqualTo
in interfaceInterfaceCheckerNumber<CheckerLong>
- Parameters:
number
- theLong
value to compare against- Returns:
- this
CheckerLong
instance for further validation
-
isGreaterOrEqualTo
Asserts that theLong
value is greater than or equal to the specifiedFloat
value.- Specified by:
isGreaterOrEqualTo
in interfaceInterfaceCheckerNumber<CheckerLong>
- Parameters:
number
- theFloat
value to compare against- Returns:
- this
CheckerLong
instance for further validation
-
isGreaterOrEqualTo
Asserts that theLong
value is greater than or equal to the specifiedDouble
value.- Specified by:
isGreaterOrEqualTo
in interfaceInterfaceCheckerNumber<CheckerLong>
- Parameters:
number
- theDouble
value to compare against- Returns:
- this
CheckerLong
instance for further validation
-
isLessThan
Asserts that theLong
value is less than the specifiedByte
value.- Specified by:
isLessThan
in interfaceInterfaceCheckerNumber<CheckerLong>
- Parameters:
number
- theByte
value to compare against- Returns:
- this
CheckerLong
instance for further validation
-
isLessThan
Asserts that theLong
value is less than the specifiedShort
value.- Specified by:
isLessThan
in interfaceInterfaceCheckerNumber<CheckerLong>
- Parameters:
number
- theShort
value to compare against- Returns:
- this
CheckerLong
instance for further validation
-
isLessThan
Asserts that theLong
value is less than the specifiedInteger
value.- Specified by:
isLessThan
in interfaceInterfaceCheckerNumber<CheckerLong>
- Parameters:
number
- theInteger
value to compare against- Returns:
- this
CheckerLong
instance for further validation
-
isLessThan
Asserts that theLong
value is less than the specifiedLong
value.- Specified by:
isLessThan
in interfaceInterfaceCheckerNumber<CheckerLong>
- Parameters:
number
- theLong
value to compare against- Returns:
- this
CheckerLong
instance for further validation
-
isLessThan
Asserts that theLong
value is less than the specifiedFloat
value.- Specified by:
isLessThan
in interfaceInterfaceCheckerNumber<CheckerLong>
- Parameters:
number
- theFloat
value to compare against- Returns:
- this
CheckerLong
instance for further validation
-
isLessThan
Asserts that theLong
value is less than the specifiedDouble
value.- Specified by:
isLessThan
in interfaceInterfaceCheckerNumber<CheckerLong>
- Parameters:
number
- theDouble
value to compare against- Returns:
- this
CheckerLong
instance for further validation
-
isLessOrEqualTo
Asserts that theLong
value is less than or equal to the specifiedByte
value.- Specified by:
isLessOrEqualTo
in interfaceInterfaceCheckerNumber<CheckerLong>
- Parameters:
number
- theByte
value to compare against- Returns:
- this
CheckerLong
instance for further validation
-
isLessOrEqualTo
Asserts that theLong
value is less than or equal to the specifiedShort
value.- Specified by:
isLessOrEqualTo
in interfaceInterfaceCheckerNumber<CheckerLong>
- Parameters:
number
- theShort
value to compare against- Returns:
- this
CheckerLong
instance for further validation
-
isLessOrEqualTo
Asserts that theLong
value is less than or equal to the specifiedInteger
value.- Specified by:
isLessOrEqualTo
in interfaceInterfaceCheckerNumber<CheckerLong>
- Parameters:
number
- theInteger
value to compare against- Returns:
- this
CheckerLong
instance for further validation
-
isLessOrEqualTo
Asserts that theLong
value is less than or equal to the specifiedLong
value.- Specified by:
isLessOrEqualTo
in interfaceInterfaceCheckerNumber<CheckerLong>
- Parameters:
number
- theLong
value to compare against- Returns:
- this
CheckerLong
instance for further validation
-
isLessOrEqualTo
Asserts that theLong
value is less than or equal to the specifiedFloat
value.- Specified by:
isLessOrEqualTo
in interfaceInterfaceCheckerNumber<CheckerLong>
- Parameters:
number
- theFloat
value to compare against- Returns:
- this
CheckerLong
instance for further validation
-
isLessOrEqualTo
Asserts that theLong
value is less than or equal to the specifiedDouble
value.- Specified by:
isLessOrEqualTo
in interfaceInterfaceCheckerNumber<CheckerLong>
- Parameters:
number
- theDouble
value to compare against- Returns:
- this
CheckerLong
instance for further validation
-