PaginatorInterface

public interface PaginatorInterface

Class that implement this interface help you manage paginated data can data that’s split across several pages.

ListPaginator this is used to resolve data that is not alot, i.e. data that can be held inthe memory with little to no cost on the app, this is usually data held in a List.

With large data that is usally stored in the database the SqlPaginator comes in handy, this paginator does not hold any data within it.

It only fetches the data and provides this data to you, its upto you to know how to store or display this data in an efficient manner.

Methods

fetchNextPageData

void fetchNextPageData()

This does the actual loading of data. The loading should be done asynchronously.

getPageCount

int getPageCount()

The total number of pages.

getTotalRecords

int getTotalRecords()

The total number of records.

setPageSize

void setPageSize(int pageSize)

The number of records to display per page.

Parameters:
  • pageSize