public final class Paginator<T>
extends java.lang.Object
Channels.getPublicChannelsList(com.twilio.chat.CallbackListener<com.twilio.chat.Paginator<com.twilio.chat.ChannelDescriptor>>)
,
Channels.getUserChannelsList(com.twilio.chat.CallbackListener<com.twilio.chat.Paginator<com.twilio.chat.ChannelDescriptor>>)
or Users.getChannelUserDescriptors(java.lang.String, com.twilio.chat.CallbackListener<com.twilio.chat.Paginator<com.twilio.chat.UserDescriptor>>)
.
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(com.twilio.chat.CallbackListener<com.twilio.chat.Paginator<T>>)
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.
Modifier and Type | Method and Description |
---|---|
void |
dispose() |
java.util.ArrayList<T> |
getItems()
Get items available in the current page.
|
long |
getPageSize()
Amount of items in the current page.
|
boolean |
hasNextPage()
If the paginator has more pages, returns true.
|
void |
requestNextPage(CallbackListener<Paginator<T>> listener)
Query the next page.
|
public java.util.ArrayList<T> getItems()
public long getPageSize()
public boolean hasNextPage()
requestNextPage(com.twilio.chat.CallbackListener<com.twilio.chat.Paginator<T>>)
public void requestNextPage(CallbackListener<Paginator<T>> listener)
listener
- Listener to receive paginator with the next page contents.hasNextPage()
public void dispose()