Class ServiceClient.Response<T>

    • Field Detail

      • myFutureResponse

        private final java.util.concurrent.CompletableFuture<java.net.http.HttpResponse<T>> myFutureResponse
    • Constructor Detail

      • Response

        Response​(ServiceClient.Request request,
                 java.util.concurrent.CompletableFuture<java.net.http.HttpResponse<T>> response)
    • Method Detail

      • cancel

        public boolean cancel()
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • getBody

        public T getBody()
      • getHeaders

        public java.net.http.HttpHeaders getHeaders()
      • getPreviousResponse

        public java.util.Optional<java.net.http.HttpResponse<T>> getPreviousResponse()
      • getRequest

        public java.net.http.HttpRequest getRequest()
        Will recreate the request that resulted in the final response. If there has been one or more redirects, then this is NOT the same as the original request.
      • getStatusCode

        public int getStatusCode()
        Returns:
        The http response status code, or -1 if this is not http/hhtps or if the code cannot be discerned from the response
      • getURI

        public java.net.URI getURI()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • isDone

        public boolean isDone()
      • isResponseOK

        public boolean isResponseOK()
        Returns:
        true if the status (response) code is in [200,300)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getResponse

        java.net.http.HttpResponse<T> getResponse()