Top Description Constructors Methods
org.assertj.core.api

public Class AtomicIntegerFieldUpdaterAssert<OBJECT>

extends AbstractAtomicFieldUpdaterAssert<AtomicIntegerFieldUpdaterAssert<OBJECT>, Integer, AtomicIntegerFieldUpdater<OBJECT>, OBJECT>
Class Inheritance
Type Parameters
<OBJECT>
the type of the object holding the updatable field.
Imports
java.util.concurrent.atomic.AtomicIntegerFieldUpdater

Assertion methods for AtomicIntegerFieldUpdaters.

To create an instance of this class, invoke Assertions#assertThat(AtomicIntegerFieldUpdater).

Author
epeee
Since
2.7.0 / 3.7.0

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected Integer
public AtomicIntegerFieldUpdaterAssert<OBJECT>

Returns:

this assertion object.
hasValue
(Integer
the expected value inside the OBJECT.
expectedValue
,
OBJECT
the object holding the updatable field.
obj
)

Overrides org.assertj.core.api.AbstractAtomicFieldUpdaterAssert.hasValue.

Verifies that the actual atomic field updater contains the given value at the given object.
Inherited from org.assertj.core.api.AbstractAtomicFieldUpdaterAssert:
validate

Constructor Detail

AtomicIntegerFieldUpdaterAssertback to summary
public AtomicIntegerFieldUpdaterAssert(AtomicIntegerFieldUpdater<OBJECT> actual)

Method Detail

getActualValueback to summary
protected Integer getActualValue(OBJECT obj)

Implements abstract org.assertj.core.api.AbstractAtomicFieldUpdaterAssert.getActualValue.

Annotations
@Override
hasValueback to summary
public AtomicIntegerFieldUpdaterAssert<OBJECT> hasValue(Integer expectedValue, OBJECT obj)

Overrides org.assertj.core.api.AbstractAtomicFieldUpdaterAssert.hasValue.

Verifies that the actual atomic field updater contains the given value at the given object.

Example:

 // person is an instance of a Person class holding a non-private volatile int field (age).
AtomicIntegerFieldUpdater<Person> ageUpdater = AtomicIntegerFieldUpdater.newUpdater(Person.class, "age");

// this assertion succeeds:
ageUpdater.set(person, 25);
assertThat(ageUpdater).hasValue(25, person);

// this assertion fails:
fieldUpdater.set(person, 28);
assertThat(fieldUpdater).hasValue(25, person);
Parameters
expectedValue:Integer

the expected value inside the OBJECT.

obj:OBJECT

the object holding the updatable field.

Returns:AtomicIntegerFieldUpdaterAssert<OBJECT>

this assertion object.

Annotations
@Override
Since
2.7.0 / 3.7.0