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 forOptionalLong
.- Author:
- Jean-Christophe Gay, Alexander Bischof, Grzegorz Piwowarek
-
-
Field Summary
-
Fields inherited from class org.assertj.core.api.AbstractAssert
actual, assertionErrorCreator, conditions, customRepresentation, info, myself, objects, printAssertionsDescription, throwUnsupportedExceptionOnEquals
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractOptionalLongAssert(OptionalLong actual, Class<?> selfType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SELF
hasValue(long expectedValue)
Verifies that the actualOptionalLong
has the value in argument.SELF
isEmpty()
Verifies that the actualOptionalLong
is empty.SELF
isNotEmpty()
Verifies that there is a value present in the actualOptionalLong
, it's an alias ofisPresent()
.SELF
isNotPresent()
Verifies that the actualOptionalLong
is empty (alias ofisEmpty()
).SELF
isPresent()
Verifies that there is a value present in the actualOptionalLong
.-
Methods inherited from class org.assertj.core.api.AbstractAssert
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, satisfiesAnyOf, satisfiesAnyOfForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, usingRecursiveComparison, usingRecursiveComparison, withAssertionState, 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 Detail
-
AbstractOptionalLongAssert
protected AbstractOptionalLongAssert(OptionalLong actual, Class<?> selfType)
-
-
Method Detail
-
isPresent
public SELF 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
public SELF 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
public SELF 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
public SELF 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
public SELF hasValue(long expectedValue)
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.
-
-