- java.lang.Object
-
- org.ojalgo.netio.ServiceClient.Response<T>
-
- All Implemented Interfaces:
BasicLogger.Printable
- Enclosing class:
- ServiceClient
public static final class ServiceClient.Response<T> extends java.lang.Object implements BasicLogger.Printable
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.CompletableFuture<java.net.http.HttpResponse<T>>myFutureResponseprivate ServiceClient.SessionmySession
-
Constructor Summary
Constructors Constructor Description Response(ServiceClient.Request request, java.util.concurrent.CompletableFuture<java.net.http.HttpResponse<T>> response)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancancel()booleanequals(java.lang.Object obj)TgetBody()java.net.http.HttpHeadersgetHeaders()java.util.Optional<java.net.http.HttpResponse<T>>getPreviousResponse()java.net.http.HttpRequestgetRequest()Will recreate the request that resulted in the final response.(package private) java.net.http.HttpResponse<T>getResponse()intgetStatusCode()java.net.URIgetURI()inthashCode()booleanisDone()booleanisResponseOK()voidprint(BasicLogger receiver)java.lang.StringtoString()
-
-
-
Field Detail
-
myFutureResponse
private final java.util.concurrent.CompletableFuture<java.net.http.HttpResponse<T>> myFutureResponse
-
mySession
private final ServiceClient.Session mySession
-
-
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:
equalsin classjava.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:
hashCodein classjava.lang.Object
-
isDone
public boolean isDone()
-
isResponseOK
public boolean isResponseOK()
- Returns:
- true if the status (response) code is in [200,300)
-
print
public void print(BasicLogger receiver)
- Specified by:
printin interfaceBasicLogger.Printable
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getResponse
java.net.http.HttpResponse<T> getResponse()
-
-