Top Description Fields Constructors Methods
com.dlsc.gemsfx.paging

public Class PagingLoadResponse<T>

extends Object
Class Inheritance
Type Parameters
<T>
the type of the items that were queried
Imports
java.util.Collections, .List, .Objects

Constructs a new load response containing the items to show for the requested page and the total item count.

Field Summary

Modifier and TypeField and Description
private final List<T>
private final int

Constructor Summary

AccessConstructor and Description
public
PagingLoadResponse(List<T>
the list of items of type T to be included in the response; must not be null
items
,
int
the total number of items available in the data source
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 TypeMethod and Description
public static <
the type of the items in the empty response
T
>
PagingLoadResponse<T>

Returns:

an empty paging load response
emptyResponse
()

An empty response with no items and no total item count.

public final List<T>

Returns:

a list of items of type T
getItems
()

Retrieves the list of items contained in the response.

public final int

Returns:

the total number of items
getTotalItemCount
()

Retrieves the total count of items contained in the response.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

itemsback to summary
private final List<T> items
totalItemCountback to summary
private final int totalItemCount

Constructor Detail

PagingLoadResponseback to summary
public PagingLoadResponse(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.

Parameters
items:List<T>

the list of items of type T to be included in the response; must not be null

totalItemCount:int

the total number of items available in the data source

Method Detail

emptyResponseback to summary
public static <T> PagingLoadResponse<T> 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.

Parameters
<T>
the type of the items in the empty response
Returns:PagingLoadResponse<T>

an empty paging load response

getItemsback to summary
public final List<T> getItems()

Retrieves the list of items contained in the response.

Returns:List<T>

a list of items of type T

getTotalItemCountback to summary
public final int getTotalItemCount()

Retrieves the total count of items contained in the response.

Returns:int

the total number of items