Package org.assertj.core.api
Class AbstractOptionalIntAssert<SELF extends AbstractOptionalIntAssert<SELF>>
- java.lang.Object
-
- org.assertj.core.api.AbstractAssert<SELF,OptionalInt>
-
- org.assertj.core.api.AbstractOptionalIntAssert<SELF>
-
- All Implemented Interfaces:
Assert<SELF,OptionalInt>,Descriptable<SELF>,ExtensionPoints<SELF,OptionalInt>
- Direct Known Subclasses:
OptionalIntAssert
public abstract class AbstractOptionalIntAssert<SELF extends AbstractOptionalIntAssert<SELF>> extends AbstractAssert<SELF,OptionalInt>
Assertions forOptionalInt.- Author:
- Jean-Christophe Gay, Alexander Bischof, Grzegorz Piwowarek
-
-
Field Summary
Fields Modifier and Type Field Description (package private) Integersintegers-
Fields inherited from class org.assertj.core.api.AbstractAssert
actual, assertionErrorCreator, conditions, info, myself, objects, throwUnsupportedExceptionOnEquals
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractOptionalIntAssert(OptionalInt actual, Class<?> selfType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SELFhasValue(int expectedValue)Verifies that the actualOptionalInthas the value in argument.SELFisEmpty()Verifies that the actualOptionalIntis empty.SELFisNotEmpty()Verifies that there is a value present in the actualOptionalInt, it's an alias ofisPresent().SELFisNotPresent()Verifies that the actualOptionalIntis empty (alias ofisEmpty()).SELFisPresent()Verifies that there is a value present in the actualOptionalInt.-
Methods inherited from class org.assertj.core.api.AbstractAssert
as, as, asInstanceOf, asList, asString, describedAs, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, equals, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, inBinary, inHexadecimal, is, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, setCustomRepresentation, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, withAssertionState, withFailMessage, withRepresentation, withThreadDumpOnError
-
-
-
-
Field Detail
-
integers
Integers integers
-
-
Constructor Detail
-
AbstractOptionalIntAssert
protected AbstractOptionalIntAssert(OptionalInt actual, Class<?> selfType)
-
-
Method Detail
-
isPresent
public SELF isPresent()
Verifies that there is a value present in the actualOptionalInt.Assertion will pass :
assertThat(OptionalInt.of(10)).isPresent();Assertion will fail :
assertThat(OptionalInt.empty()).isPresent();- Returns:
- this assertion object.
- Throws:
AssertionError- if actual value is empty.AssertionError- if actual is null.
-
isNotPresent
public SELF isNotPresent()
Verifies that the actualOptionalIntis empty (alias ofisEmpty()).Assertion will pass :
Assertion will fail :assertThat(OptionalInt.empty()).isNotPresent();assertThat(OptionalInt.of(10)).isNotPresent();- Returns:
- this assertion object.
-
isEmpty
public SELF isEmpty()
Verifies that the actualOptionalIntis empty.Assertion will pass :
assertThat(OptionalInt.empty()).isEmpty();Assertion will fail :
assertThat(OptionalInt.of(10)).isEmpty();- Returns:
- this assertion object.
- Throws:
AssertionError- if actual value is present.AssertionError- if actual is null.
-
isNotEmpty
public SELF isNotEmpty()
Verifies that there is a value present in the actualOptionalInt, it's an alias ofisPresent().Assertion will pass :
assertThat(OptionalInt.of(10)).isNotEmpty();Assertion will fail :
assertThat(OptionalInt.empty()).isNotEmpty();- Returns:
- this assertion object.
- Throws:
AssertionError- if actual value is empty.AssertionError- if actual is null.
-
hasValue
public SELF hasValue(int expectedValue)
Verifies that the actualOptionalInthas the value in argument.Assertion will pass :
assertThat(OptionalInt.of(8)).hasValue(8); assertThat(OptionalInt.of(8)).hasValue(Integer.valueOf(8));Assertion will fail :
assertThat(OptionalInt.empty()).hasValue(8); assertThat(OptionalInt.of(7)).hasValue(8);- Parameters:
expectedValue- the expected value inside theOptionalInt.- Returns:
- this assertion object.
- Throws:
AssertionError- if actual value is empty.AssertionError- if actual is null.AssertionError- if actual has not the value as expected.
-
-