Top Description Fields Constructors Methods
org.assertj.core.api

public abstract Class AbstractDoubleAssert<SELF extends AbstractDoubleAssert<SELF>>

extends AbstractComparableAssert<SELF extends AbstractDoubleAssert<SELF>, Double>
implements FloatingPointNumberAssert<SELF extends AbstractDoubleAssert<SELF>, Double>
Class Inheritance
All Implemented Interfaces
org.assertj.core.api.FloatingPointNumberAssert, org.assertj.core.api.NumberAssert
Known Direct Subclasses
org.assertj.core.api.DoubleAssert
Type Parameters
<SELF>
the "self" type of this assertion class. Please read "Emulating 'self types' using Java Generics to simplify fluent API implementation" for more details.
Static Imports
org.assertj.core.error.ShouldBeEqual.shouldBeEqual, .ShouldBeGreaterOrEqual.shouldBeGreaterOrEqual, .ShouldBeLessOrEqual.shouldBeLessOrEqual, .ShouldNotBeEqual.shouldNotBeEqual

Base class for all implementations of assertions for Doubles.
Authors
Drummond Dawson, Yvonne Wang, David DIDIER, Alex Ruiz, Ansgar Konermann, Joel Costigliola, Mikhail Mazursky, Nicolas François, Jack Gough

Field Summary

Modifier and TypeField and Description
pack-priv Doubles
private final boolean
private static final Double
Inherited from org.assertj.core.api.AbstractComparableAssert:
comparables

Constructor Summary

AccessConstructor and Description
protected
AbstractDoubleAssert(Double actual, Class<?> selfType)

public
AbstractDoubleAssert(double actual, Class<?> selfType)

Method Summary

Modifier and TypeMethod and Description
private void
private void
public SELF
isBetween(Double
the start value (inclusive), expected not to be null.
start
,
Double
the end value (inclusive), expected not to be null.
end
)

Overrides org.assertj.core.api.AbstractComparableAssert.isBetween.

Implements org.assertj.core.api.NumberAssert.isBetween, org.assertj.core.api.ComparableAssert.isBetween.

Verifies that the actual value is in [start, end] range (start included, end included).
public SELF

Returns:

this assertion object.
isCloseTo
(final double
the given number to compare the actual value to.
expected
,
final Offset<Double>
the given positive offset.
offset
)

Implements org.assertj.core.api.FloatingPointNumberAssert.isCloseTo.

Verifies that the actual number is close to the given one within the given offset value.
public SELF

Returns:

this assertion object.
isCloseTo
(Double
the given number to compare the actual value to.
expected
,
Offset<Double>
the given positive offset.
offset
)

Implements org.assertj.core.api.FloatingPointNumberAssert.isCloseTo.

Verifies that the actual number is close to the given one within the given offset value.
public SELF

Returns:

this assertion object.
isCloseTo
(Double
the given number to compare the actual value to.
expected
,
Percentage
the given positive percentage.
percentage
)

Implements org.assertj.core.api.NumberAssert.isCloseTo.

Verifies that the actual number is close to the given one within the given percentage.
public SELF

Returns:

this assertion object.
isCloseTo
(double
the given number to compare the actual value to.
expected
,
Percentage
the given positive percentage.
percentage
)

Implements org.assertj.core.api.NumberAssert.isCloseTo.

Verifies that the actual number is close to the given one within the given percentage.
public SELF

Returns:

this assertion object.
isEqualTo
(double
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.
isEqualTo
(Double
the given value to compare the actual value to.
expected
)

Verifies that the actual value is equal to the given one using Double#equals(Object) semantics where:

  • Double.valueOf(Double.NaN).equals(Double.NaN) == true but Double.NaN != Double.NaN
  • Double.valueOf(0.0).equals(-0.0) == false but 0.0 == -0.0
public SELF
isEqualTo(Double
the given value to compare the actual value to.
expected
,
Offset<Double>
the given positive offset.
offset
)

Implements org.assertj.core.api.FloatingPointNumberAssert.isEqualTo.

Verifies that the actual number is close to the given one within the given offset value.
public SELF

Returns:

this assertion object.
isEqualTo
(double
the given value to compare the actual value to.
expected
,
Offset<Double>
the given positive offset.
offset
)

Implements org.assertj.core.api.FloatingPointNumberAssert.isEqualTo.

Verifies that the actual number is close to the given one within the given offset value.
public SELF

Returns:

this assertion object.
isFinite
()

Implements org.assertj.core.api.FloatingPointNumberAssert.isFinite.

Verifies that the double value is a finite floating-point value.
public SELF

Returns:

this assertion object.
isGreaterThan
(double
the given value to compare the actual value to.
other
)

Overrides org.assertj.core.api.AbstractComparableAssert.isGreaterThan.

Implements org.assertj.core.api.ComparableAssert.isGreaterThan.

Verifies that the actual value is greater than the given one.
public SELF

Returns:

this assertion object.
isGreaterThanOrEqualTo
(double
the given value to compare the actual value to.
other
)

Overrides org.assertj.core.api.AbstractComparableAssert.isGreaterThanOrEqualTo.

Implements org.assertj.core.api.ComparableAssert.isGreaterThanOrEqualTo.

Verifies that the actual value is greater than or equal to the given one.
public SELF

Returns:

this assertion object.
isGreaterThanOrEqualTo
(Double
the given value to compare the actual value to.
other
)

Overrides org.assertj.core.api.AbstractComparableAssert.isGreaterThanOrEqualTo.

Implements org.assertj.core.api.ComparableAssert.isGreaterThanOrEqualTo.

Verifies that the actual value is greater than or equal to the given one using Double#compareTo(Double) semantics where notably 0.0 is strictly greater than -0.0.
public SELF

Returns:

this assertion object.
isInfinite
()

Implements org.assertj.core.api.FloatingPointNumberAssert.isInfinite.

Verifies that the double value represents positive infinity or negative infinity.
public SELF

Returns:

this assertion object.
isLessThan
(double
the given value to compare the actual value to.
other
)

Overrides org.assertj.core.api.AbstractComparableAssert.isLessThan.

Implements org.assertj.core.api.ComparableAssert.isLessThan.

Verifies that the actual value is less than the given one.
public SELF

Returns:

this assertion object.
isLessThanOrEqualTo
(double
the given value to compare the actual value to.
other
)

Overrides org.assertj.core.api.AbstractComparableAssert.isLessThanOrEqualTo.

Implements org.assertj.core.api.ComparableAssert.isLessThanOrEqualTo.

Verifies that the actual value is less than or equal to the given one.
public SELF

Returns:

this assertion object.
isLessThanOrEqualTo
(Double
the given value to compare the actual value to.
other
)

Overrides org.assertj.core.api.AbstractComparableAssert.isLessThanOrEqualTo.

Implements org.assertj.core.api.ComparableAssert.isLessThanOrEqualTo.

Verifies that the actual value is less than or equal to the given one using Double#compareTo(Double) semantics where notably -0.0 is strictly less than 0.0.
public SELF
isNaN()

Implements org.assertj.core.api.FloatingPointNumberAssert.isNaN.

Verifies that the actual value is equal to NaN.
public SELF
isNegative()

Implements org.assertj.core.api.NumberAssert.isNegative.

Verifies that the actual value is negative.
public SELF

Returns:

this assertion object.
isNotCloseTo
(final double
the given number to compare the actual value to.
expected
,
final Offset<Double>
the given positive offset.
offset
)

Implements org.assertj.core.api.FloatingPointNumberAssert.isNotCloseTo.

Verifies that the actual number is not close to the given one by less than the given offset.
public SELF

Returns:

this assertion object.
isNotCloseTo
(Double
the given number to compare the actual value to.
expected
,
Offset<Double>
the given positive offset.
offset
)

Implements org.assertj.core.api.FloatingPointNumberAssert.isNotCloseTo.

Verifies that the actual number is not close to the given one by less than the given offset.
public SELF

Returns:

this assertion object.
isNotCloseTo
(Double
the given number to compare the actual value to.
expected
,
Percentage
the given positive percentage.
percentage
)

Implements org.assertj.core.api.NumberAssert.isNotCloseTo.

Verifies that the actual number is close to the given one within the given percentage.
public SELF

Returns:

this assertion object.
isNotCloseTo
(double
the given number to compare the actual value to.
expected
,
Percentage
the given positive percentage.
percentage
)

Implements org.assertj.core.api.NumberAssert.isNotCloseTo.

Verifies that the actual number is not close to the given one within the given percentage.
public SELF

Returns:

this assertion object.
isNotEqualTo
(double
the given value to compare the actual value to.
other
)

Verifies that the actual value is not equal to the given one.

public SELF

Returns:

this assertion object.
isNotEqualTo
(Double
the given value to compare the actual value to.
other
)

Verifies that the actual value is not equal to the given Double using Double#equals(Object) semantics where

  • Double.valueOf(Double.NaN).equals(Double.NaN) == true but Double.NaN != Double.NaN
  • Double.valueOf(0.0).equals(-0.0) == false but 0.0 == -0.0
public SELF

Returns:

this assertion object.
isNotFinite
()

Implements org.assertj.core.api.FloatingPointNumberAssert.isNotFinite.

Verifies that the double value is not a finite floating-point value.
public SELF

Returns:

this assertion object.
isNotInfinite
()

Implements org.assertj.core.api.FloatingPointNumberAssert.isNotInfinite.

Verifies that the double value represents neither positive infinity nor negative infinity.
public SELF
isNotNaN()

Implements org.assertj.core.api.FloatingPointNumberAssert.isNotNaN.

Verifies that the actual value is not equal to NaN.
public SELF
isNotNegative()

Implements org.assertj.core.api.NumberAssert.isNotNegative.

Verifies that the actual value is non negative (positive or equal zero).
public SELF
isNotPositive()

Implements org.assertj.core.api.NumberAssert.isNotPositive.

Verifies that the actual value is non positive (negative or equal zero).
public SELF

Returns:

this assertion object.
isNotZero
()

Implements org.assertj.core.api.NumberAssert.isNotZero.

Verifies that the actual value is not equal to zero.
public SELF
isOne()

Implements org.assertj.core.api.NumberAssert.isOne.

Verifies that the actual value is equal to one.
public SELF
isPositive()

Implements org.assertj.core.api.NumberAssert.isPositive.

Verifies that the actual value is positive.
public SELF
isStrictlyBetween(Double
the start value (exclusive), expected not to be null.
start
,
Double
the end value (exclusive), expected not to be null.
end
)

Overrides org.assertj.core.api.AbstractComparableAssert.isStrictlyBetween.

Implements org.assertj.core.api.NumberAssert.isStrictlyBetween, org.assertj.core.api.ComparableAssert.isStrictlyBetween.

Verifies that the actual value is in ]start, end[ range (start excluded, end excluded).
public SELF

Returns:

this assertion object.
isZero
()

Implements org.assertj.core.api.NumberAssert.isZero.

Verifies that the actual value is equal to zero.
private boolean
public SELF
usingComparator(Comparator<? super Double>
the comparator to use for the incoming assertion checks.
customComparator
)

Overrides org.assertj.core.api.AbstractComparableAssert.usingComparator.

Implements org.assertj.core.api.Assert.usingComparator.

Use the given custom comparator instead of relying on actual type A equals method for incoming assertion checks.
public SELF
usingComparator(Comparator<? super Double>
the comparator to use for the incoming assertion checks.
customComparator
,
String
comparator description to be used in assertion error messages
customComparatorDescription
)

Overrides org.assertj.core.api.AbstractComparableAssert.usingComparator.

Implements org.assertj.core.api.Assert.usingComparator.

Use the given custom comparator instead of relying on actual type A equals method for incoming assertion checks.
public SELF
Inherited from org.assertj.core.api.AbstractComparableAssert:
inBinaryinHexadecimalisEqualByComparingToisNotEqualByComparingTo