K - the type of key emitted by the viewV - the type of value emitted by the viewpublic interface ViewResponse<K,V> extends java.lang.Iterable<ViewResponse<K,V>>
Provides methods to facilitate processing of the response.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
ViewResponse.Row<K,V>
Encapsulates a single row from the response results array.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<Document> |
getDocs() |
<D> java.util.List<D> |
getDocsAs(java.lang.Class<D> docType)
Deserializes the included full content of result documents to a list of the specified type.
|
java.lang.Long |
getFirstRowCount() |
java.util.List<K> |
getKeys() |
java.lang.Long |
getLastRowCount() |
java.lang.String |
getNextPageToken()
Returns an opaque pagination token for the next page of results, which can be used with
ViewRequest.getResponse(String) to retrieve the next page without keeping
ViewResponse state. |
java.lang.Long |
getPageNumber()
Get the page number of this response.
|
java.lang.String |
getPreviousPageToken()
Returns an opaque pagination token for the previous page of results, which can be used with
ViewRequest.getResponse(String) to retrieve the previous page without keeping
ViewResponse state. |
java.util.List<ViewResponse.Row<K,V>> |
getRows() |
java.lang.Long |
getTotalRowCount() |
java.util.List<V> |
getValues() |
boolean |
hasNextPage() |
boolean |
hasPreviousPage() |
ViewResponse<K,V> |
nextPage() |
ViewResponse<K,V> |
previousPage() |
java.util.List<ViewResponse.Row<K,V>> getRows()
java.util.List<K> getKeys()
java.util.List<V> getValues()
java.util.List<Document> getDocs()
java.lang.IllegalStateException - if include_docs was false<D> java.util.List<D> getDocsAs(java.lang.Class<D> docType)
D - the type of the documentdocType - the class type to deserialize the JSON document tojava.lang.IllegalStateException - if include_docs was falseboolean hasNextPage()
boolean hasPreviousPage()
ViewResponse<K,V> nextPage() throws java.io.IOException
java.io.IOException - if there is an error communicating with the serverViewResponse<K,V> previousPage() throws java.io.IOException
java.io.IOException - if there is an error communicating with the serverjava.lang.String getNextPageToken()
ViewRequest.getResponse(String) to retrieve the next page without keeping
ViewResponse state.null if there is no next pageViewRequest.getResponse(String)java.lang.String getPreviousPageToken()
ViewRequest.getResponse(String) to retrieve the previous page without keeping
ViewResponse state.null if there is no
previous pageViewRequest.getResponse(String)java.lang.Long getPageNumber()
Get the page number of this response.
Useful for displaying a page number when using
ViewRequestBuilder.newPaginatedRequest(Key.Type, Class)
Will always be 1 for an unpaginated request using
ViewRequestBuilder.newRequest(Key.Type, Class)
java.lang.Long getFirstRowCount()
java.lang.Long getLastRowCount()
java.lang.Long getTotalRowCount()