public abstract class AbstractOptionalIntAssert<S extends AbstractOptionalIntAssert<S>> extends AbstractAssert<S,OptionalInt>
OptionalInt.actual, info, myself| Modifier | Constructor and Description |
|---|---|
protected |
AbstractOptionalIntAssert(OptionalInt actual,
Class<?> selfType) |
| Modifier and Type | Method and Description |
|---|---|
S |
hasValue(int expectedValue)
Verifies that the actual
OptionalInt has the value in argument. |
S |
isEmpty()
Verifies that the actual
OptionalInt is empty. |
S |
isNotEmpty()
Verifies that there is a value present in the actual
OptionalInt, it's an alias of isPresent(). |
S |
isNotPresent()
Verifies that the actual
OptionalInt is empty (alias of isEmpty()). |
S |
isPresent()
Verifies that there is a value present in the actual
OptionalInt. |
as, as, asList, asString, describedAs, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, equals, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, 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, overridingErrorMessage, satisfies, setCustomRepresentation, throwAssertionError, usingComparator, usingDefaultComparator, withFailMessage, withRepresentation, withThreadDumpOnErrorprotected AbstractOptionalIntAssert(OptionalInt actual, Class<?> selfType)
public S isPresent()
OptionalInt.
Assertion will pass :
assertThat(OptionalInt.of(10)).isPresent();
Assertion will fail :
assertThat(OptionalInt.empty()).isPresent();AssertionError - if actual value is empty.AssertionError - if actual is null.public S isNotPresent()
OptionalInt is empty (alias of isEmpty()).
Assertion will pass :
assertThat(OptionalInt.empty()).isNotPresent();
Assertion will fail :
assertThat(OptionalInt.of(10)).isNotPresent();public S isEmpty()
OptionalInt is empty.
Assertion will pass :
assertThat(OptionalInt.empty()).isEmpty();
Assertion will fail :
assertThat(OptionalInt.of(10)).isEmpty();AssertionError - if actual value is present.AssertionError - if actual is null.public S isNotEmpty()
OptionalInt, it's an alias of isPresent().
Assertion will pass :
assertThat(OptionalInt.of(10)).isNotEmpty();
Assertion will fail :
assertThat(OptionalInt.empty()).isNotEmpty();AssertionError - if actual value is empty.AssertionError - if actual is null.public S 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.AssertionError - if actual value is empty.AssertionError - if actual is null.AssertionError - if actual has not the value as expected.Copyright © 2014–2017 AssertJ. All rights reserved.