Package org.assertj.core.api
Class AbstractOptionalLongAssert<SELF extends AbstractOptionalLongAssert<SELF>>
java.lang.Object
org.assertj.core.api.AbstractAssert<SELF,OptionalLong>
org.assertj.core.api.AbstractOptionalLongAssert<SELF>
- All Implemented Interfaces:
Assert<SELF,
,OptionalLong> Descriptable<SELF>
,ExtensionPoints<SELF,
OptionalLong>
- Direct Known Subclasses:
OptionalLongAssert
public abstract class AbstractOptionalLongAssert<SELF extends AbstractOptionalLongAssert<SELF>>
extends AbstractAssert<SELF,OptionalLong>
Assertions for
OptionalLong
.- Author:
- Jean-Christophe Gay, Alexander Bischof, Grzegorz Piwowarek
-
Field Summary
Fields inherited from class org.assertj.core.api.AbstractAssert
actual, info, myself, objects, throwUnsupportedExceptionOnEquals
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractOptionalLongAssert
(OptionalLong actual, Class<?> selfType) -
Method Summary
Modifier and TypeMethodDescriptionhasValue
(long expectedValue) Verifies that the actualOptionalLong
has the value in argument.isEmpty()
Verifies that the actualOptionalLong
is empty.Verifies that there is a value present in the actualOptionalLong
, it's an alias ofisPresent()
.Verifies that the actualOptionalLong
is empty (alias ofisEmpty()
).Verifies that there is a value present in the actualOptionalLong
.Methods inherited from class org.assertj.core.api.AbstractAssert
areEqual, asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, inBinary, inHexadecimal, is, isElementOfCustomAssert, 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, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOfForProxy, satisfiesForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, 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, as, describedAs
-
Constructor Details
-
AbstractOptionalLongAssert
-
-
Method Details
-
isPresent
Verifies that there is a value present in the actualOptionalLong
.Assertion will pass :
assertThat(OptionalLong.of(10)).isPresent();
Assertion will fail :
assertThat(OptionalLong.empty()).isPresent();
- Returns:
- this assertion object.
- Throws:
AssertionError
- if actual value is empty.AssertionError
- if actual is null.
-
isNotPresent
Verifies that the actualOptionalLong
is empty (alias ofisEmpty()
).Assertion will pass :
Assertion will fail :assertThat(OptionalLong.empty()).isNotPresent();
assertThat(OptionalLong.of(10)).isNotPresent();
- Returns:
- this assertion object.
-
isEmpty
Verifies that the actualOptionalLong
is empty.Assertion will pass :
assertThat(OptionalLong.empty()).isEmpty();
Assertion will fail :
assertThat(OptionalLong.of(10)).isEmpty();
- Returns:
- this assertion object.
- Throws:
AssertionError
- if actual value is present.AssertionError
- if actual is null.
-
isNotEmpty
Verifies that there is a value present in the actualOptionalLong
, it's an alias ofisPresent()
.Assertion will pass :
assertThat(OptionalLong.of(10)).isNotEmpty();
Assertion will fail :
assertThat(OptionalLong.empty()).isNotEmpty();
- Returns:
- this assertion object.
- Throws:
AssertionError
- if actual value is empty.AssertionError
- if actual is null.
-
hasValue
Verifies that the actualOptionalLong
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);
- Parameters:
expectedValue
- the expected value inside theOptionalLong
.- 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.
-