ResponseBase<H,T> Class

  • java.lang.Object
    • com.azure.core.http.rest.ResponseBase<H,T>

Type Parameters

H

The deserialized type of the response headers.

T

The deserialized type of the response value, available from Response#getValue().

Implements

public class ResponseBase<H,T>
implements Response<T>

The response of a REST request.

Constructor Summary

Constructor Description
ResponseBase(HttpRequest request, int statusCode, HttpHeaders headers, T value, H deserializedHeaders)

Creates a ResponseBase<H,T>.

Method Summary

Modifier and Type Method and Description
H getDeserializedHeaders()

Get the headers from the HTTP response, transformed into the header type, H.

HttpHeaders getHeaders()

Gets the headers from the HTTP response.

HttpRequest getRequest()

Gets The request which resulted in this ResponseBase<H,T>.

int getStatusCode()

Gets the HTTP response status code.

T getValue()

Gets the deserialized value of the HTTP response.

Methods inherited from java.lang.Object

Constructor Details

ResponseBase

public ResponseBase(HttpRequest request, int statusCode, HttpHeaders headers, T value, H deserializedHeaders)

Creates a ResponseBase<H,T>.

Parameters:

request - The HTTP 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.
deserializedHeaders - The deserialized headers of the HTTP response.

Method Details

getDeserializedHeaders

public H getDeserializedHeaders()

Get the headers from the HTTP response, transformed into the header type, H.

Returns:

An instance of header type H, deserialized from the HTTP response headers.

getHeaders

public HttpHeaders getHeaders()

Gets the headers from the HTTP response.

getRequest

public HttpRequest getRequest()

Gets The request which resulted in this ResponseBase<H,T>.

Returns:

The request which resulted in this ResponseBase<H,T>.

getStatusCode

public int getStatusCode()

Gets the HTTP response status code.

getValue

public T getValue()

Gets the deserialized value of the HTTP response.

Applies to