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, Integer page, Integer pageSize, Integer totalItems)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<T>getItems()IntegergetPage()IntegergetPageSize()IntegergetTotalItems()voidsetItems(List<T> items)voidsetPage(Integer page)voidsetPageSize(Integer pageSize)voidsetTotalItems(Integer totalItems)
-
-
-
Constructor Detail
-
PaginatedResult
public PaginatedResult()
Default constructor that initializes the items with an empty list.
-
PaginatedResult
public PaginatedResult(List<T> items, Integer page, Integer pageSize, Integer 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 Integer getPage()
- Returns:
- the number of the page.
-
getPageSize
public Integer getPageSize()
- Returns:
- the maximum number of elements the
getItems()can contain.
-
setPageSize
public void setPageSize(Integer pageSize)
- Parameters:
pageSize- seegetPageSize().
-
getTotalItems
public Integer 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(Integer totalItems)
- Parameters:
totalItems- seegetTotalItems().
-
-