Top Description Constructors Methods
org.assertj.core.internal

public abstract Class RealNumbers<NUMBER extends Number & Comparable<NUMBER>>

extends Numbers<NUMBER extends Number & Comparable<NUMBER>>
Class Inheritance
Known Direct Subclasses
org.assertj.core.internal.Doubles, org.assertj.core.internal.Floats
Static Imports
org.assertj.core.error.ShouldBeFinite.shouldBeFinite, .ShouldBeInfinite.shouldBeInfinite, .ShouldNotBeFinite.shouldNotBeFinite, .ShouldNotBeInfinite.shouldNotBeInfinite

Base class of reusable assertions for real numbers (float and double).
Author
Joel Costigliola

Constructor Summary

AccessConstructor and Description
protected
protected
RealNumbers(ComparisonStrategy comparisonStrategy)

Method Summary

Modifier and TypeMethod and Description
protected BigDecimal
absBigDecimalDiff(NUMBER number1, NUMBER number2)

public void
assertIsFinite(AssertionInfo info, NUMBER actual)

public void
assertIsInfinite(AssertionInfo info, NUMBER actual)

public void
assertIsNaN(AssertionInfo
contains information about the assertion.
info
,
NUMBER
the actual value.
actual
)

Verifies that the actual value is equal to NaN.

public void
assertIsNotFinite(AssertionInfo info, NUMBER actual)

public void
assertIsNotInfinite(AssertionInfo info, NUMBER actual)

public void
assertIsNotNaN(AssertionInfo
contains information about the assertion.
info
,
NUMBER
the actual value.
actual
)

Verifies that the actual value is not equal to NaN.

protected abstract boolean
isFinite(NUMBER value)

protected boolean
isGreaterThan(NUMBER value, NUMBER other)

Implements abstract org.assertj.core.internal.Numbers.isGreaterThan.

protected abstract boolean
isInfinite(NUMBER value)

protected abstract boolean
isNaN(NUMBER value)

public boolean

Returns:

true is if the given value is Nan or Infinite, false otherwise.
isNanOrInfinite
(NUMBER
the value to check
value
)

Returns true is if the given value is Nan or Infinite, false otherwise.

protected abstract boolean
isNotFinite(NUMBER value)

protected abstract boolean
isNotInfinite(NUMBER value)

protected abstract NUMBER
NaN()

Inherited from org.assertj.core.internal.Numbers:
absDiffareEqualassertIsBetweenassertIsCloseToassertIsCloseToPercentageassertIsNegativeassertIsNotCloseToassertIsNotCloseToPercentageassertIsNotNegativeassertIsNotPositiveassertIsNotZeroassertIsOneassertIsPositiveassertIsStrictlyBetweenassertIsZeroisGreaterThanOrEqualToonezero

Constructor Detail

RealNumbersback to summary
protected RealNumbers()
RealNumbersback to summary
protected RealNumbers(ComparisonStrategy comparisonStrategy)

Method Detail

absBigDecimalDiffback to summary
protected BigDecimal absBigDecimalDiff(NUMBER number1, NUMBER number2)
assertIsFiniteback to summary
public void assertIsFinite(AssertionInfo info, NUMBER actual)
assertIsInfiniteback to summary
public void assertIsInfinite(AssertionInfo info, NUMBER actual)
assertIsNaNback to summary
public void assertIsNaN(AssertionInfo info, NUMBER actual)

Verifies that the actual value is equal to NaN.
It does not rely on the custom comparisonStrategy (if one is set).

Parameters
info:AssertionInfo

contains information about the assertion.

actual:NUMBER

the actual value.

Exceptions
AssertionError:
if the actual value is not equal to NaN.
assertIsNotFiniteback to summary
public void assertIsNotFinite(AssertionInfo info, NUMBER actual)
assertIsNotInfiniteback to summary
public void assertIsNotInfinite(AssertionInfo info, NUMBER actual)
assertIsNotNaNback to summary
public void assertIsNotNaN(AssertionInfo info, NUMBER actual)

Verifies that the actual value is not equal to NaN.

Parameters
info:AssertionInfo

contains information about the assertion.

actual:NUMBER

the actual value.

Exceptions
AssertionError:
if the actual value is equal to NaN.
isFiniteback to summary
protected abstract boolean isFinite(NUMBER value)
isGreaterThanback to summary
protected boolean isGreaterThan(NUMBER value, NUMBER other)

Implements abstract org.assertj.core.internal.Numbers.isGreaterThan.

Annotations
@Override
isInfiniteback to summary
protected abstract boolean isInfinite(NUMBER value)
isNaNback to summary
protected abstract boolean isNaN(NUMBER value)
isNanOrInfiniteback to summary
public boolean isNanOrInfinite(NUMBER value)

Returns true is if the given value is Nan or Infinite, false otherwise.

Parameters
value:NUMBER

the value to check

Returns:boolean

true is if the given value is Nan or Infinite, false otherwise.

isNotFiniteback to summary
protected abstract boolean isNotFinite(NUMBER value)
isNotInfiniteback to summary
protected abstract boolean isNotInfinite(NUMBER value)
NaNback to summary
protected abstract NUMBER NaN()