public abstract class AbstractOptionalIntAssert<SELF extends AbstractOptionalIntAssert<SELF>> extends AbstractAssert<SELF,OptionalInt>
OptionalInt
.actual, info, myself, throwUnsupportedExceptionOnEquals
Modifier | Constructor and Description |
---|---|
protected |
AbstractOptionalIntAssert(OptionalInt actual,
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, 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, withFailMessage, withRepresentation, withThreadDumpOnError
protected AbstractOptionalIntAssert(OptionalInt actual, Class<?> selfType)
public SELF 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 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();
AssertionError
- if actual value is present.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();
AssertionError
- if actual value is empty.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
.AssertionError
- if actual value is empty.AssertionError
- if actual is null.AssertionError
- if actual has not the value as expected.Copyright © 2014–2019 AssertJ. All rights reserved.