Package com.azure.core.http.rest
Class SimpleResponse<T>
java.lang.Object
com.azure.core.http.rest.SimpleResponse<T>
- Type Parameters:
T
- The deserialized type of the response content.
- All Implemented Interfaces:
Response<T>
- Direct Known Subclasses:
StreamResponse
REST response with a strongly-typed content specified.
-
Constructor Summary
ConstructorDescriptionSimpleResponse
(HttpRequest request, int statusCode, HttpHeaders headers, T value) Creates aSimpleResponse
.SimpleResponse
(Response<?> response, T value) Creates aSimpleResponse
from a response and a value. -
Method Summary
Modifier and TypeMethodDescriptionGets the headers from the HTTP response.Gets the request which resulted in thisSimpleResponse
.int
Gets the status code of the HTTP response.getValue()
Gets the deserialized value of the HTTP response.
-
Constructor Details
-
SimpleResponse
Creates aSimpleResponse
.- Parameters:
request
- The request which resulted in this response.statusCode
- The status code of the HTTP response.headers
- The headers of the HTTP response.value
- The deserialized value of the HTTP response.
-
SimpleResponse
Creates aSimpleResponse
from a response and a value.- Parameters:
response
- The response that needs to be mapped.value
- The value to put into the new response.
-
-
Method Details
-
getRequest
Gets the request which resulted in thisSimpleResponse
.- Specified by:
getRequest
in interfaceResponse<T>
- Returns:
- The request which resulted in this
SimpleResponse
.
-
getStatusCode
public int getStatusCode()Gets the status code of the HTTP response.- Specified by:
getStatusCode
in interfaceResponse<T>
- Returns:
- The status code of the HTTP response.
-
getHeaders
Gets the headers from the HTTP response.- Specified by:
getHeaders
in interfaceResponse<T>
- Returns:
- The HTTP response headers.
-
getValue
Gets the deserialized value of the HTTP response.
-