Paginated Response

constructor(data: List<T>, page: Int, pageSize: Int, repository: CrudRepository<*, *>)

Constructor to init the PaginatedResponse

Parameters

data

The data retrieved by the request

page

The number of the page requested

pageSize

The size of the maximum items for page

repository

The CrudRepository used to retrieve the data from the database, it is used to automatically detect if the page is the last one available


constructor(data: List<T>, page: Int, pageSize: Int, totalDataCount: Long)

Constructor to init the PaginatedResponse

Parameters

data

The data retrieved by the request

page

The number of the page requested

pageSize

The size of the maximum items for page

totalDataCount

The total amount of data available, it is used to automatically detect if the page is the last one available


constructor(data: List<T>, page: Int, pageSize: Int, isLastPage: Boolean)

Constructor to init the PaginatedResponse

Parameters

data

The data retrieved by the request

page

The number of the page requested

pageSize

The size of the maximum items for page

isLastPage

Whether the retrieved page is the last available


constructor(hPage: JsonHelper, supplier: (JSONObject) -> T)

Constructor to init the PaginatedResponse

Parameters

hPage

The helper to fetch from the response the data to use for the PaginatedResponse

supplier

The supplier function to instantiate the T item for the data list