Class PagingLoadResponse<T>

java.lang.Object
com.dlsc.gemsfx.paging.PagingLoadResponse<T>
Type Parameters:
T - the type of the items that were queried

public class PagingLoadResponse<T> extends Object
Constructs a new load response containing the items to show for the requested page and the total item count.
  • Constructor Details

    • PagingLoadResponse

      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 - the list of items of type T to be included in the response; must not be null
      totalItemCount - the total number of items available in the data source
  • Method Details

    • getItems

      public final List<T> getItems()
      Retrieves the list of items contained in the response.
      Returns:
      a list of items of type T
    • getTotalItemCount

      public final int getTotalItemCount()
      Retrieves the total count of items contained in the response.
      Returns:
      the total number of items
    • emptyResponse

      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.
      Type Parameters:
      T - the type of the items in the empty response
      Returns:
      an empty paging load response