Package 

Class Try.Failure

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
      Try.Failure(F exception)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      Boolean isSuccess()
      Boolean isFailure()
      final F getException()
      S getOrThrow() Returns the encapsulated value if this instance represents success or throws the encapsulated Throwable exception if it is failure.
      S getOrNull() Returns the encapsulated value if this instance represents success or null if it is failure.
      F exceptionOrNull() Returns the encapsulated Throwable exception if this instance represents failure or null if it is success.
      • Methods inherited from class org.readium.r2.shared.util.Try

        fold, map, mapFailure, onFailure, onSuccess
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Try.Failure

        Try.Failure(F exception)
    • Method Detail

      • getOrThrow

         S getOrThrow()

        Returns the encapsulated value if this instance represents success or throws the encapsulated Throwable exception if it is failure.

      • getOrNull

         S getOrNull()

        Returns the encapsulated value if this instance represents success or null if it is failure.

      • exceptionOrNull

         F exceptionOrNull()

        Returns the encapsulated Throwable exception if this instance represents failure or null if it is success.