D
- type of the data.public class Page<D> extends Object implements Serializable
Constructor and Description |
---|
Page(List<D> data,
PageRequest pageRequest,
long totalRecordCount,
long totalPageCount)
Creates a data page.
|
Modifier and Type | Method and Description |
---|---|
<T> Page<T> |
convert(Converter<D,T> converter)
Converts a page to a different data type.
|
static <T> Page<T> |
emptyPage()
Returns the empty page (immutable).
|
List<D> |
getData()
Gets the page data.
|
PageRequest |
getNextPageRequest()
Creates a request for the next page.
|
long |
getPageCount()
Gets the total number of pages.
|
PageRequest |
getPageRequest()
Gets the request that generated this page.
|
PageRequest |
getPreviousPageRequest()
Creates a request for the previous page.
|
long |
getRecordCount()
Gets the total number of records.
|
boolean |
hasNext()
Checks whether there is a page after this one.
|
boolean |
hasPrevious()
Checks whether there is a page previous to this one.
|
boolean |
isEmpty()
Determines if a page is empty (contains no data)
|
public Page(List<D> data, PageRequest pageRequest, long totalRecordCount, long totalPageCount)
data
- page's data.pageRequest
- request that generated this page.totalRecordCount
- total number of records.totalPageCount
- total number of pages.public static final <T> Page<T> emptyPage()
public boolean isEmpty()
public PageRequest getPageRequest()
public long getPageCount()
public long getRecordCount()
public <T> Page<T> convert(Converter<D,T> converter)
converter
- converter.public boolean hasNext()
true
if there is a page after this one, false
otherwise.public boolean hasPrevious()
true
if there is a page previous to this one,
false
otherwise.public PageRequest getNextPageRequest()
null
otherwise.public PageRequest getPreviousPageRequest()
null
otherwise.Copyright © 2015. All Rights Reserved.