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

public abstract Class AbstractFloatAssert<SELF extends AbstractFloatAssert<SELF>>

extends AbstractComparableAssert<SELF extends AbstractFloatAssert<SELF>, Float>
implements FloatingPointNumberAssert<SELF extends AbstractFloatAssert<SELF>, Float>
Class Inheritance
All Implemented Interfaces
org.assertj.core.api.FloatingPointNumberAssert, org.assertj.core.api.NumberAssert
Known Direct Subclasses
org.assertj.core.api.FloatAssert
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 Floats.
Authors
Drummond Dawson, Yvonne Wang, Alex Ruiz, Ansgar Konermann, Mikhail Mazursky, Nicolas François, Jin Kwon

Field Summary

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

Constructor Summary

AccessConstructor and Description
protected
AbstractFloatAssert(Float actual, Class<?> selfType)

public
AbstractFloatAssert(float actual, Class<?> selfType)

Method Summary

Modifier and TypeMethod and Description
private void
private void
public SELF
isBetween(Float
the start value (inclusive), expected not to be null.
start
,
Float
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 float
the given number to compare the actual value to.
expected
,
final Offset<Float>
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
(Float
the given number to compare the actual value to.
expected
,
Offset<Float>
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
(Float
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
(float
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
(float
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
(Float
the given value to compare the actual value to.
expected
)

Verifies that the actual value is equal to the given one using Float#equals(Object) semantics where 0.0f is not equal to -0.0f.

public SELF

Returns:

this assertion object.
isEqualTo
(Float
the given value to compare the actual value to.
expected
,
Offset<Float>
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
(float
the given value to compare the actual value to.
expected
,
Offset<Float>
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 float value is a finite floating-point value.
public SELF

Returns:

this assertion object.
isGreaterThan
(float
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
(float
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
(Float
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 Float#compareTo(Float) semantics where notably 0.0f is strictly greater than -0.0f.
public SELF

Returns:

this assertion object.
isInfinite
()

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

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

Returns:

this assertion object.
isLessThan
(float
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
(float
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
(Float
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 Float#compareTo(Float) 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 float
the given number to compare the actual value to.
expected
,
final Offset<Float>
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
(Float
the given number to compare the actual value to.
expected
,
Offset<Float>
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
(Float
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.
isNotCloseTo
(float
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
(float
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
(Float
the given value to compare the actual value to.
other
)

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

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

Returns:

this assertion object.
isNotFinite
()

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

Verifies that the float 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 float 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(Float
the start value (exclusive), expected not to be null.
start
,
Float
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 Float>
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 Float>
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