Class PagedResponseBase<H,T>
- java.lang.Object
-
- com.azure.android.core.rest.util.paging.PagedResponseBase<H,T>
-
- Type Parameters:
H
- The HTTP response headersT
- The type of items contained in thePage
- All Implemented Interfaces:
Response<java.util.List<T>>
,PagedResponse<T>
,com.azure.android.core.util.paging.Page<java.lang.String,T>
,java.io.Closeable
,java.lang.AutoCloseable
public class PagedResponseBase<H,T> extends java.lang.Object implements PagedResponse<T>
Represents an HTTP response that contains a list of items deserialized into aPage
.- See Also:
PagedResponse
-
-
Constructor Summary
Constructors Constructor Description PagedResponseBase(com.azure.android.core.http.HttpRequest request, int statusCode, com.azure.android.core.http.HttpHeaders headers, com.azure.android.core.util.paging.Page<java.lang.String,T> page, H deserializedHeaders)
Creates a new instance of the PagedResponseBase type.PagedResponseBase(com.azure.android.core.http.HttpRequest request, int statusCode, com.azure.android.core.http.HttpHeaders headers, java.util.List<T> items, java.lang.String continuationToken, H deserializedHeaders)
Creates a new instance of the PagedResponseBase type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
java.lang.String
getContinuationToken()
H
getDeserializedHeaders()
Get the headers from the HTTP response, transformed into the header type H.java.util.List<T>
getElements()
com.azure.android.core.http.HttpHeaders
getHeaders()
Gets the headers from the HTTP response.com.azure.android.core.http.HttpRequest
getRequest()
Gets the HTTP request which resulted in this response.int
getStatusCode()
Gets the HTTP response status code.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.azure.android.core.rest.util.paging.PagedResponse
getValue
-
-
-
-
Constructor Detail
-
PagedResponseBase
public PagedResponseBase(com.azure.android.core.http.HttpRequest request, int statusCode, com.azure.android.core.http.HttpHeaders headers, com.azure.android.core.util.paging.Page<java.lang.String,T> page, H deserializedHeaders)
Creates a new instance of the PagedResponseBase type.- Parameters:
request
- The HttpRequest that was sent to the service whose response resulted in this response.statusCode
- The status code from the response.headers
- The headers from the response.page
- The page of content returned from the service within the response.deserializedHeaders
- The headers, deserialized into an instance of type H.
-
PagedResponseBase
public PagedResponseBase(com.azure.android.core.http.HttpRequest request, int statusCode, com.azure.android.core.http.HttpHeaders headers, java.util.List<T> items, java.lang.String continuationToken, H deserializedHeaders)
Creates a new instance of the PagedResponseBase type.- Parameters:
request
- The HttpRequest that was sent to the service whose response resulted in this response.statusCode
- The status code from the response.headers
- The headers from the response.items
- The items returned from the service within the response.continuationToken
- The continuation token returned from the service, to enable future requests to pick up from the same place in the paged iteration.deserializedHeaders
- The headers, deserialized into an instance of type H.
-
-
Method Detail
-
getElements
public java.util.List<T> getElements()
-
getContinuationToken
public java.lang.String getContinuationToken()
-
getStatusCode
public int getStatusCode()
Gets the HTTP response status code.- Specified by:
getStatusCode
in interfaceResponse<H>
- Returns:
- The status code of the HTTP response.
-
getHeaders
public com.azure.android.core.http.HttpHeaders getHeaders()
Gets the headers from the HTTP response.- Specified by:
getHeaders
in interfaceResponse<H>
- Returns:
- The HTTP response headers.
-
getRequest
public com.azure.android.core.http.HttpRequest getRequest()
Description copied from interface:Response
Gets the HTTP request which resulted in this response.- Specified by:
getRequest
in interfaceResponse<H>
- Returns:
- the request which resulted in this paged response.
-
getDeserializedHeaders
public H getDeserializedHeaders()
Get the headers from the HTTP response, transformed into the header type H.- Returns:
- an instance of header type H, containing the HTTP response headers.
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
-