Class PagingLoadResponse<T>
java.lang.Object
com.dlsc.gemsfx.paging.PagingLoadResponse<T>
- Type Parameters:
T- the type of the items that were queried
Constructs a new load response containing the items to show for the requested page
and the total item count.
-
Constructor Summary
ConstructorsConstructorDescriptionPagingLoadResponse(List<T> items, int totalItemCount) Constructs a new load response containing the items to display for the requested page and the total number of available items. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> PagingLoadResponse<T> An empty response with no items and no total item count.getItems()Retrieves the list of items contained in the response.final intRetrieves the total count of items contained in the response.
-
Constructor Details
-
PagingLoadResponse
Constructs a new load response containing the items to display for the requested page and the total number of available items.- Parameters:
items- the list of items of type T to be included in the response; must not be nulltotalItemCount- the total number of items available in the data source
-
-
Method Details
-
getItems
-
getTotalItemCount
public final int getTotalItemCount()Retrieves the total count of items contained in the response.- Returns:
- the total number of items
-
emptyResponse
An empty response with no items and no total item count. This is useful when some preconditions for running a query are not met. Then the loader can simply return this empty response.- Type Parameters:
T- the type of the items in the empty response- Returns:
- an empty paging load response
-