Class Client.ResponseOrError<T>

java.lang.Object
com.yahoo.search.dispatch.rpc.Client.ResponseOrError<T>
Enclosing interface:
Client

public static class Client.ResponseOrError<T> extends Object
  • Method Details

    • fromResponse

      public static <T> Client.ResponseOrError<T> fromResponse(T response)
    • fromError

      public static <T> Client.ResponseOrError<T> fromError(String error)
    • fromTimeoutError

      public static <T> Client.ResponseOrError<T> fromTimeoutError(String error)
    • response

      public Optional<T> response()
      Returns the response, or empty if there is an error
    • error

      public Optional<String> error()
      Returns the error or empty if there is a response
    • timeout

      public boolean timeout()
      Returns:
      true if error is a timeout