Package com.azure.core.http.rest
Class PagedResponseBase<H,T>
- java.lang.Object
-
- com.azure.core.http.rest.PagedResponseBase<H,T>
-
- Type Parameters:
H- The HTTP response headersT- The type of items contained in thePage
- All Implemented Interfaces:
Page<T>,PagedResponse<T>,Response<List<T>>,ContinuablePage<String,T>,Closeable,AutoCloseable
public class PagedResponseBase<H,T> extends 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(HttpRequest request, int statusCode, HttpHeaders headers, Page<T> page, H deserializedHeaders)Creates a new instance of the PagedResponseBase type.PagedResponseBase(HttpRequest request, int statusCode, HttpHeaders headers, List<T> items, 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 voidclose()StringgetContinuationToken()Gets the reference to the next page.HgetDeserializedHeaders()Get the headers from the HTTP response, transformed into the header type H.IterableStream<T>getElements()Gets anIterableStreamof elements in the page.HttpHeadersgetHeaders()Gets the headers from the HTTP response.HttpRequestgetRequest()Gets the HTTP request which resulted in this response.intgetStatusCode()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.core.http.rest.PagedResponse
getValue
-
-
-
-
Constructor Detail
-
PagedResponseBase
public PagedResponseBase(HttpRequest request, int statusCode, HttpHeaders headers, Page<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(HttpRequest request, int statusCode, HttpHeaders headers, List<T> items, 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 IterableStream<T> getElements()
Gets anIterableStreamof elements in the page.- Specified by:
getElementsin interfaceContinuablePage<H,T>- Returns:
- An
IterableStreamcontaining the elements in the page.
-
getContinuationToken
public String getContinuationToken()
Gets the reference to the next page.- Specified by:
getContinuationTokenin interfaceContinuablePage<H,T>- Returns:
- The next page reference or
nullif there isn't a next page.
-
getStatusCode
public int getStatusCode()
Gets the HTTP response status code.- Specified by:
getStatusCodein interfaceResponse<H>- Returns:
- The status code of the HTTP response.
-
getHeaders
public HttpHeaders getHeaders()
Gets the headers from the HTTP response.- Specified by:
getHeadersin interfaceResponse<H>- Returns:
- The HTTP response headers.
-
getRequest
public HttpRequest getRequest()
Description copied from interface:ResponseGets the HTTP request which resulted in this response.- Specified by:
getRequestin interfaceResponse<H>- Returns:
- the request which resulted in this PagedRequestResponse.
-
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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
-