Class 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 Detail

      • 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
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object