Class PaginatedResult<T>
java.lang.Object
com.xwiki.projectmanagement.model.PaginatedResult<T>
- Type Parameters:
T- the type of the data held by this class.
The representation of a paginated result that contains useful information for following requests, such as the
total number of requested items present in the database.
- Since:
- 1.0
- Version:
- $Id$
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor that initializes the items with an empty list.PaginatedResult(List<T> items, int page, int pageSize, int totalItems) -
Method Summary
Modifier and TypeMethodDescriptiongetItems()intgetPage()intintvoidvoidsetPage(int page) voidsetPageSize(int pageSize) voidsetTotalItems(int totalItems)
-
Constructor Details
-
PaginatedResult
public PaginatedResult()Default constructor that initializes the items with an empty list. -
PaginatedResult
- Parameters:
items- the items contained by this paginated result. The size of the items should be smaller than the pageSize.page- which page does this object represent.pageSize- the number of items present in this paginated result.totalItems- the total number of items that can are present in the store where this paginated result is retrieved.
-
-
Method Details
-
getItems
- Returns:
- the list of items that are present in this paginated result.
-
setItems
- Parameters:
items- seegetItems().
-
getPage
public int getPage()- Returns:
- the number of the page.
-
setPage
public void setPage(int page) - Parameters:
page- seegetPage().
-
getPageSize
public int getPageSize()- Returns:
- the maximum number of elements the
getItems()can contain.
-
setPageSize
public void setPageSize(int pageSize) - Parameters:
pageSize- seegetPageSize().
-
getTotalItems
public int getTotalItems()- Returns:
- the total number of items that can be retrieved from the store where this paginated result was retrieved from.
-
setTotalItems
public void setTotalItems(int totalItems) - Parameters:
totalItems- seegetTotalItems().
-