Pagination

public interface Pagination


Pagination object for SearchResponse. There could be more than one page of results in a single search, using Pagination to fetch the next page of results.

Summary

Public methods

abstract Task<SearchResponse>

Fetches the next page of results.

abstract @Nullable Integer

Returns the maximum number of results in the next page of results.

abstract boolean

Returns whether there is a next page of results.

abstract void

Sets the maximum number of results in the next page of results.

Public methods

fetchNextPage

abstract Task<SearchResponsefetchNextPage()

Fetches the next page of results.

If the next page is empty, the SearchResponse will have empty list of places and null Pagination.

Each fetch next page request is treated as a new request and triggers billing. The same PlacesClient object used for the first request is used to fetch the next page of results.

Throws
java.lang.IllegalStateException

if another fetch next page request is in progress.

getPageSize

abstract @Nullable Integer getPageSize()

Returns the maximum number of results in the next page of results.

hasNextPage

abstract boolean hasNextPage()

Returns whether there is a next page of results.

setPageSize

abstract void setPageSize(@Nullable Integer pageSize)

Sets the maximum number of results in the next page of results. Page size must be in the range of 1 to 20, inclusive. If null, the default page size will be used.