Class ResponseOrException<R>

java.lang.Object
software.amazon.awssdk.core.internal.waiters.ResponseOrException<R>
Type Parameters:
R - response type

public final class ResponseOrException<R> extends Object
Represents a value that can be either a response or a Throwable
  • Method Details

    • response

      public Optional<R> response()
      Returns:
      the optional response that has matched with the waiter success condition
    • exception

      public Optional<Throwable> exception()
      Returns:
      the optional exception that has matched with the waiter success condition
    • response

      public static <R> ResponseOrException<R> response(R value)
      Create a new ResponseOrException with the response
      Type Parameters:
      R - Response type
      Parameters:
      value - response
    • exception

      public static <R> ResponseOrException<R> exception(Throwable value)
      Create a new ResponseOrException with the exception
      Type Parameters:
      R - Response type
      Parameters:
      value - exception
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object