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) Integers
integers
-
Fields inherited from class org.assertj.core.api.AbstractAssert
actual, assertionErrorCreator, conditions, info, myself, objects, throwUnsupportedExceptionOnEquals
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractOptionalIntAssert(OptionalInt actual, Class<?> selfType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SELF
hasValue(int expectedValue)
Verifies that the actualOptionalInt
has the value in argument.SELF
isEmpty()
Verifies that the actualOptionalInt
is empty.SELF
isNotEmpty()
Verifies that there is a value present in the actualOptionalInt
, it's an alias ofisPresent()
.SELF
isNotPresent()
Verifies that the actualOptionalInt
is empty (alias ofisEmpty()
).SELF
isPresent()
Verifies that there is a value present in the actualOptionalInt
.-
Methods inherited from class org.assertj.core.api.AbstractAssert
asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, equals, extracting, extracting, failWithActualExpectedAndMessage, 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, overridingErrorMessage, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOf, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, usingRecursiveComparison, usingRecursiveComparison, withAssertionState, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnError
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.assertj.core.api.Descriptable
as, as, describedAs
-
-
-
-
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 actualOptionalInt
is 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 actualOptionalInt
is 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 actualOptionalInt
has 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.
-
-