public abstract class AbstractOptionalIntAssert<SELF extends AbstractOptionalIntAssert<SELF>> extends AbstractAssert<SELF,java.util.OptionalInt>
OptionalInt
.Modifier and Type | Field and Description |
---|---|
(package private) Integers |
integers |
actual, assertionErrorCreator, conditions, info, myself, objects, throwUnsupportedExceptionOnEquals
Modifier | Constructor and Description |
---|---|
protected |
AbstractOptionalIntAssert(java.util.OptionalInt actual,
java.lang.Class<?> selfType) |
Modifier and Type | Method and Description |
---|---|
SELF |
hasValue(int expectedValue)
Verifies that the actual
OptionalInt has the value in argument. |
SELF |
isEmpty()
Verifies that the actual
OptionalInt is empty. |
SELF |
isNotEmpty()
Verifies that there is a value present in the actual
OptionalInt , it's an alias of isPresent() . |
SELF |
isNotPresent()
Verifies that the actual
OptionalInt is empty (alias of isEmpty() ). |
SELF |
isPresent()
Verifies that there is a value present in the actual
OptionalInt . |
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
Integers integers
protected AbstractOptionalIntAssert(java.util.OptionalInt actual, java.lang.Class<?> selfType)
public SELF isPresent()
OptionalInt
.
Assertion will pass :
assertThat(OptionalInt.of(10)).isPresent();
Assertion will fail :
assertThat(OptionalInt.empty()).isPresent();
java.lang.AssertionError
- if actual value is empty.java.lang.AssertionError
- if actual is null.public SELF isNotPresent()
OptionalInt
is empty (alias of isEmpty()
).
Assertion will pass :
assertThat(OptionalInt.empty()).isNotPresent();
Assertion will fail :
assertThat(OptionalInt.of(10)).isNotPresent();
public SELF isEmpty()
OptionalInt
is empty.
Assertion will pass :
assertThat(OptionalInt.empty()).isEmpty();
Assertion will fail :
assertThat(OptionalInt.of(10)).isEmpty();
java.lang.AssertionError
- if actual value is present.java.lang.AssertionError
- if actual is null.public SELF isNotEmpty()
OptionalInt
, it's an alias of isPresent()
.
Assertion will pass :
assertThat(OptionalInt.of(10)).isNotEmpty();
Assertion will fail :
assertThat(OptionalInt.empty()).isNotEmpty();
java.lang.AssertionError
- if actual value is empty.java.lang.AssertionError
- if actual is null.public SELF hasValue(int expectedValue)
OptionalInt
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);
expectedValue
- the expected value inside the OptionalInt
.java.lang.AssertionError
- if actual value is empty.java.lang.AssertionError
- if actual is null.java.lang.AssertionError
- if actual has not the value as expected.