public abstract class AbstractOptionalLongAssert<SELF extends AbstractOptionalLongAssert<SELF>> extends AbstractAssert<SELF,OptionalLong>
OptionalLong
.actual, info, myself, throwUnsupportedExceptionOnEquals
Modifier | Constructor and Description |
---|---|
protected |
AbstractOptionalLongAssert(OptionalLong actual,
Class<?> selfType) |
Modifier and Type | Method and Description |
---|---|
SELF |
hasValue(long expectedValue)
Verifies that the actual
OptionalLong has the value in argument. |
SELF |
isEmpty()
Verifies that the actual
OptionalLong is empty. |
SELF |
isNotEmpty()
Verifies that there is a value present in the actual
OptionalLong , it's an alias of isPresent() . |
SELF |
isNotPresent()
Verifies that the actual
OptionalLong is empty (alias of isEmpty() ). |
SELF |
isPresent()
Verifies that there is a value present in the actual
OptionalLong . |
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 AbstractOptionalLongAssert(OptionalLong actual, Class<?> selfType)
public SELF isPresent()
OptionalLong
.
Assertion will pass :
assertThat(OptionalLong.of(10)).isPresent();
Assertion will fail :
assertThat(OptionalLong.empty()).isPresent();
AssertionError
- if actual value is empty.AssertionError
- if actual is null.public SELF isNotPresent()
OptionalLong
is empty (alias of isEmpty()
).
Assertion will pass :
assertThat(OptionalLong.empty()).isNotPresent();
Assertion will fail :
assertThat(OptionalLong.of(10)).isNotPresent();
public SELF isEmpty()
OptionalLong
is empty.
Assertion will pass :
assertThat(OptionalLong.empty()).isEmpty();
Assertion will fail :
assertThat(OptionalLong.of(10)).isEmpty();
AssertionError
- if actual value is present.AssertionError
- if actual is null.public SELF isNotEmpty()
OptionalLong
, it's an alias of isPresent()
.
Assertion will pass :
assertThat(OptionalLong.of(10)).isNotEmpty();
Assertion will fail :
assertThat(OptionalLong.empty()).isNotEmpty();
AssertionError
- if actual value is empty.AssertionError
- if actual is null.public SELF hasValue(long expectedValue)
OptionalLong
has the value in argument.
Assertion will pass :
assertThat(OptionalLong.of(8)).hasValue(8);
assertThat(OptionalLong.of(8)).hasValue(Integer.valueOf(8));
Assertion will fail :
assertThat(OptionalLong.empty()).hasValue(8);
assertThat(OptionalLong.of(7)).hasValue(8);
expectedValue
- the expected value inside the OptionalLong
.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.