Class Try.Success<T>

java.lang.Object
io.reacted.patterns.Try<T>
io.reacted.patterns.Try.Success<T>
Enclosing class:
Try<T>

public static final class Try.Success<T>
extends Try<T>
  • Method Details

    • valueOf

      public static <T> Try.Success<T> valueOf​(T successValue)
    • get

      public T get()
      A successful Try holds a value that can be retrieved with this method. Please note that if the success value is NULL, you will get a Try.Success whose value returned by this get() is NULL If it's the case, please consider to use the toOptional() and stream() methods for safely process successful non-null result values
      Specified by:
      get in class Try<T>
      Returns:
      returns the value contained in the Try
    • isSuccess

      public boolean isSuccess()
      Specified by:
      isSuccess in class Try<T>
      Returns:
      true if the operation has been successful. False otherwise
    • getCause

      public java.lang.Throwable getCause()
      A successful Try does not have any cause
      Specified by:
      getCause in class Try<T>
      Returns:
      None
      Throws:
      java.lang.UnsupportedOperationException - This operation is not allowed on Success