Class PaginatedResult<T>
- java.lang.Object
-
- com.xwiki.projectmanagement.model.PaginatedResult<T>
-
- Type Parameters:
T- the type of the data held by this class.
public class PaginatedResult<T> extends Object
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
Constructors Constructor Description PaginatedResult()Default constructor that initializes the items with an empty list.PaginatedResult(List<T> items, int page, int pageSize, int totalItems)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<T>getItems()intgetPage()intgetPageSize()intgetTotalItems()voidsetItems(List<T> items)voidsetPage(int page)voidsetPageSize(int pageSize)voidsetTotalItems(int totalItems)
-
-
-
Constructor Detail
-
PaginatedResult
public PaginatedResult()
Default constructor that initializes the items with an empty list.
-
PaginatedResult
public PaginatedResult(List<T> items, int page, int pageSize, int totalItems)
- 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 Detail
-
getItems
public List<T> getItems()
- Returns:
- the list of items that are present in this paginated result.
-
setItems
public void setItems(List<T> items)
- 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().
-
-