Class OptionAssert<V>

java.lang.Object
org.assertj.core.api.AbstractAssert<OptionAssert<V>, Option<V>>
dmx.fun.assertj.OptionAssert<V>
Type Parameters:
V - the type of the optional value
All Implemented Interfaces:
org.assertj.core.api.Assert<OptionAssert<V>, Option<V>>, org.assertj.core.api.Descriptable<OptionAssert<V>>, org.assertj.core.api.ExtensionPoints<OptionAssert<V>, Option<V>>

@NullMarked public final class OptionAssert<V> extends org.assertj.core.api.AbstractAssert<OptionAssert<V>, Option<V>>
AssertJ assertions for Option.

Obtain instances via DmxFunAssertions.assertThat(Option).

  • Field Summary

    Fields inherited from class org.assertj.core.api.AbstractAssert

    actual, info, myself, objects, throwUnsupportedExceptionOnEquals
  • Method Summary

    Modifier and Type
    Method
    Description
    containsValue(V expected)
    Verifies that the Option is Some and contains the given value.
    Verifies that the Option is Some and that its value satisfies the given requirement.
    Verifies that the Option is None.
    Verifies that the Option is Some.

    Methods inherited from class org.assertj.core.api.AbstractAssert

    actual, areEqual, asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, doesNotHaveToString, doesNotMatch, doesNotMatch, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, 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, usingEquals, usingEquals, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnError

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.assertj.core.api.Descriptable

    as, as, as, describedAs, describedAs
  • Method Details

    • isSome

      public OptionAssert<V> isSome()
      Verifies that the Option is Some.
      Returns:
      this assertion for chaining
    • isNone

      public OptionAssert<V> isNone()
      Verifies that the Option is None.
      Returns:
      this assertion for chaining
    • containsValue

      public OptionAssert<V> containsValue(V expected)
      Verifies that the Option is Some and contains the given value.
      Parameters:
      expected - the expected value
      Returns:
      this assertion for chaining
    • hasValueSatisfying

      public OptionAssert<V> hasValueSatisfying(Consumer<V> requirement)
      Verifies that the Option is Some and that its value satisfies the given requirement.
      Parameters:
      requirement - a consumer that performs assertions on the value
      Returns:
      this assertion for chaining