Integers.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv Integers |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| private static boolean | |
| public SELF | isBetween(Integer
the start value (inclusive), expected not to be null. start, Integer the end value (inclusive), expected not to be null. end)Overrides org. Implements org. |
| public SELF | Returns: this assertion object.the given int to compare the actual value to. expected, Offset<Integer> the given positive offset. offset)Implements org. |
| public SELF | Returns: this assertion object.the given int to compare the actual value to. expected, Offset<Integer> the given positive offset. offset)Implements org. |
| public SELF | Returns: this assertion object.the given number to compare the actual value to. expected, Percentage the given positive percentage. percentage)Implements org. |
| public SELF | Returns: this assertion object.the given number to compare the actual value to. expected, Percentage the given positive percentage. percentage)Implements org. |
| public SELF | Returns: this assertion object.the given value to compare the actual value to. expected)Verifies that the actual value is equal to the given one. |
| public SELF | Returns: this assertion object.the given value to compare the actual value to. expected)Verifies that the actual value is equal to the given long. |
| public SELF | |
| public SELF | Returns: this assertion object.the given value to compare the actual value to. other)Overrides org. Implements org. |
| public SELF | Returns: this assertion object.the given value to compare the actual value to. other)Overrides org. Implements org. |
| public SELF | Returns: this assertion object.the given value to compare the actual value to. other)Overrides org. Implements org. |
| public SELF | Returns: this assertion object.the given value to compare the actual value to. other)Overrides org. Implements org. |
| public SELF | isNegative()
Implements org. |
| public SELF | Returns: this assertion object.the given int to compare the actual value to. expected, Offset<Integer> the given positive offset. offset)Implements org. |
| public SELF | Returns: this assertion object.the given int to compare the actual value to. expected, Offset<Integer> the given positive offset. offset)Implements org. |
| public SELF | Returns: this assertion object.the given number to compare the actual value to. expected, Percentage the given positive percentage. percentage)Implements org. |
| public SELF | Returns: this assertion object.the given number to compare the actual value to. expected, Percentage the given positive percentage. percentage)Implements org. |
| public SELF | Returns: this assertion object.the given value to compare the actual value to. other)Verifies that the actual value is not equal to the given one. |
| public SELF | isNotNegative()
Implements org. |
| public SELF | isNotPositive()
Implements org. |
| public SELF | isNotZero()
Implements org. |
| public SELF | |
| public SELF | isOne()
Implements org. |
| public SELF | isPositive()
Implements org. |
| public SELF | isStrictlyBetween(Integer
the start value (exclusive), expected not to be null. start, Integer the end value (exclusive), expected not to be null. end)Overrides org. Implements org. |
| public SELF | isZero()
Implements org. |
| public SELF | usingComparator(Comparator<? super Integer>
the comparator to use for the incoming assertion checks. customComparator)Overrides org. Implements org. |
| public SELF | usingComparator(Comparator<? super Integer>
the comparator to use for the incoming assertion checks. customComparator, String comparator description to be used in assertion error messages customComparatorDescription)Overrides org. Implements org. |
| public SELF | usingDefaultComparator()
Overrides org. Implements org. |
| integers | back to summary |
|---|---|
| pack-priv Integers integers
| |
| AbstractIntegerAssert | back to summary |
|---|---|
| protected AbstractIntegerAssert(Integer actual, Class<?> selfType) | |
| canBeCastToInt | back to summary |
|---|---|
| private static boolean canBeCastToInt(long expected) | |
| isBetween | back to summary |
|---|---|
| public SELF isBetween(Integer start, Integer end) Overrides org. Implements org. Verifies that the actual value is in [start, end] range (start included, end included). Example:
| |
| isCloseTo | back to summary |
|---|---|
| public SELF isCloseTo(int expected, Offset<Integer> offset) Implements org. Verifies that the actual number is close to the given one within the given offset value. When abs(actual - expected) == offset value, the assertion:
Breaking change since 2.9.0/3.9.0: using Examples:
| |
| isCloseTo | back to summary |
|---|---|
| public SELF isCloseTo(Integer expected, Offset<Integer> offset) Implements org. Verifies that the actual number is close to the given one within the given offset value. When abs(actual - expected) == offset value, the assertion:
Breaking change since 2.9.0/3.9.0: using Examples:
| |
| isCloseTo | back to summary |
|---|---|
| public SELF isCloseTo(Integer expected, Percentage percentage) Implements org. Verifies that the actual number is close to the given one within the given percentage. Example with integer:
| |
| isCloseTo | back to summary |
|---|---|
| public SELF isCloseTo(int expected, Percentage percentage) Implements org. Verifies that the actual number is close to the given one within the given percentage. Example with integer:
| |
| isEqualTo | back to summary |
|---|---|
| public SELF isEqualTo(int expected) Verifies that the actual value is equal to the given one. Example:
| |
| isEqualTo | back to summary |
|---|---|
| public SELF isEqualTo(long expected) Verifies that the actual value is equal to the given long.
If the long value is not in [ Example:
| |
| isEven | back to summary |
|---|---|
| public SELF isEven() Verifies that the actual value is even. Example:
| |
| isGreaterThan | back to summary |
|---|---|
| public SELF isGreaterThan(int other) Overrides org. Implements org. Verifies that the actual value is greater than the given one. Example:
| |
| isGreaterThanOrEqualTo | back to summary |
|---|---|
| public SELF isGreaterThanOrEqualTo(int other) Overrides org. Implements org. Verifies that the actual value is greater than or equal to the given one. Example:
| |
| isLessThan | back to summary |
|---|---|
| public SELF isLessThan(int other) Overrides org. Implements org. Verifies that the actual value is less than the given one. Example:
| |
| isLessThanOrEqualTo | back to summary |
|---|---|
| public SELF isLessThanOrEqualTo(int other) Overrides org. Implements org. Verifies that the actual value is less than or equal to the given one. Example:
| |
| isNegative | back to summary |
|---|---|
| public SELF isNegative() Implements org. Doc from org. Verifies that the actual value is negative. Example:
| |
| isNotCloseTo | back to summary |
|---|---|
| public SELF isNotCloseTo(int expected, Offset<Integer> offset) Implements org. Verifies that the actual number is not close to the given one by less than the given offset. When abs(actual - expected) == offset value, the assertion:
Breaking change since 2.9.0/3.9.0: using Examples:
| |
| isNotCloseTo | back to summary |
|---|---|
| public SELF isNotCloseTo(Integer expected, Offset<Integer> offset) Implements org. Verifies that the actual number is not close to the given one by less than the given offset. When abs(actual - expected) == offset value, the assertion:
Breaking change since 2.9.0/3.9.0: using Examples:
| |
| isNotCloseTo | back to summary |
|---|---|
| public SELF isNotCloseTo(Integer expected, Percentage percentage) Implements org. Verifies that the actual number is not close to the given one by the given percentage. Example with integer:
| |
| isNotCloseTo | back to summary |
|---|---|
| public SELF isNotCloseTo(int expected, Percentage percentage) Implements org. Verifies that the actual number is not close to the given one by the given percentage. Example with integer:
| |
| isNotEqualTo | back to summary |
|---|---|
| public SELF isNotEqualTo(int other) Verifies that the actual value is not equal to the given one. Example:
| |
| isNotNegative | back to summary |
|---|---|
| public SELF isNotNegative() Implements org. Doc from org. Verifies that the actual value is non negative (positive or equal zero). Example:
| |
| isNotPositive | back to summary |
|---|---|
| public SELF isNotPositive() Implements org. Doc from org. Verifies that the actual value is non positive (negative or equal zero). Example:
| |
| isNotZero | back to summary |
|---|---|
| public SELF isNotZero() Implements org. Doc from org. Verifies that the actual value is not equal to zero. Example:
| |
| isOdd | back to summary |
|---|---|
| public SELF isOdd() Verifies that the actual value is odd. Example:
| |
| isOne | back to summary |
|---|---|
| public SELF isOne() Implements org. Doc from org. Verifies that the actual value is equal to one. Example:
| |
| isPositive | back to summary |
|---|---|
| public SELF isPositive() Implements org. Doc from org. Verifies that the actual value is positive. Example:
| |
| isStrictlyBetween | back to summary |
|---|---|
| public SELF isStrictlyBetween(Integer start, Integer end) Overrides org. Implements org. Verifies that the actual value is in ]start, end[ range (start excluded, end excluded). Example:
| |
| isZero | back to summary |
|---|---|
| public SELF isZero() Implements org. Doc from org. Verifies that the actual value is equal to zero. Example:
| |
| usingComparator | back to summary |
|---|---|
| public SELF usingComparator(Comparator<? super Integer> customComparator) Overrides org. Implements org. Doc from org. Use the given custom comparator instead of relying on actual type A equals method for incoming assertion checks. The custom comparator is bound to assertion instance, meaning that if a new assertion instance is created, the default comparison strategy will be used. Examples :
| |
| usingComparator | back to summary |
|---|---|
| public SELF usingComparator(Comparator<? super Integer> customComparator, String customComparatorDescription) Overrides org. Implements org. Doc from org. Use the given custom comparator instead of relying on actual type A equals method for incoming assertion checks. The custom comparator is bound to assertion instance, meaning that if a new assertion instance is created, the default comparison strategy will be used. Examples :
| |
| usingDefaultComparator | back to summary |
|---|---|
| public SELF usingDefaultComparator() Overrides org. Implements org. Doc from org. Revert to standard comparison for the incoming assertion checks.
This method should be used to disable a custom comparison strategy set by calling
| |