Chat Android SDK  5.1.0
com.twilio.chat.Paginator< T > Class Template Reference

Class for paginating over items retrieved using Channels.getPublicChannelsList(), Channels.getUserChannelsList() or Users.getChannelUserDescriptors(). More...

Public Member Functions

Getters
ArrayList< T > getItems ()
 Get items available in the current page. More...
 
long getPageSize ()
 Amount of items in the current page. More...
 
boolean hasNextPage ()
 If the paginator has more pages, returns true. More...
 
void requestNextPage (CallbackListener< Paginator< T >> listener)
 Query the next page. More...
 

Detailed Description

Class for paginating over items retrieved using Channels.getPublicChannelsList(), Channels.getUserChannelsList() or Users.getChannelUserDescriptors().

Paginator represents a single page of results. You can get items in this page using getItems().

The number if items in page can be retrieved using getPageSize().

If all items did not fit into single page hasNextPage() will return true. You could use requestNextPage() to get the next page of results.

If hasNextPage() returns false, then this is the last page. Calling requestNextPage() on the last page will throw IllegalStateException.

Member Function Documentation

ArrayList<T> com.twilio.chat.Paginator< T >.getItems ( )

Get items available in the current page.

Returns
ArrayList of items.
long com.twilio.chat.Paginator< T >.getPageSize ( )

Amount of items in the current page.

Returns
Count of items in the page.
boolean com.twilio.chat.Paginator< T >.hasNextPage ( )

If the paginator has more pages, returns true.

Returns
true if more pages available, false otherwise.
See also
requestNextPage
void com.twilio.chat.Paginator< T >.requestNextPage ( CallbackListener< Paginator< T >>  listener)

Query the next page.

Parameters
listenerListener to receive paginator with the next page contents.
See also
hasNextPage