T - The entity typepublic final class PageData<T>
extends java.lang.Object
| Constructor and Description |
|---|
PageData(java.util.List<T> content,
int page,
int size,
long total)
Create page data
|
| Modifier and Type | Method and Description |
|---|---|
static <E> PageData<E> |
create(int page,
int size)
Create empty page data
|
static <E> PageData<E> |
create(java.util.List<E> content,
int page,
int size,
long total)
Create page data
|
java.util.List<T> |
getContent()
Returns data content
|
int |
getPage()
Returns page index
|
long |
getPages()
Returns total pages count
|
int |
getSize()
Returns page size
|
long |
getTotal()
Returns total count of data content
|
boolean |
isEmpty()
Returns true if the content is empty
|
boolean |
isFirst() |
boolean |
isLast() |
<S> PageData<S> |
map(java.util.function.Function<T,S> fun)
Use this method, translate objects to another type objects
|
public PageData(java.util.List<T> content, int page, int size, long total)
content - Data content, if null then create empty list internalpage - Page index must be great than or equal 1size - Page size must be great than or equal 1total - Total count must be great than or equal 0public static <E> PageData<E> create(int page, int size)
E - The element class type of the contentpage - Page index must be great than or equal 1size - Page size must be great than or equal 1public static <E> PageData<E> create(java.util.List<E> content, int page, int size, long total)
E - The element class type of the contentcontent - Data content, if null then create empty list internalpage - Page index must be great than or equal 1size - Page size must be great than or equal 1total - Total count must be great than or equal 0public <S> PageData<S> map(java.util.function.Function<T,S> fun)
S - Target object classfun - Translator functionpublic boolean isEmpty()
public java.util.List<T> getContent()
public int getPage()
public int getSize()
public long getPages()
public long getTotal()
public boolean isFirst()
truepublic boolean isLast()
trueCopyright © 2020. All Rights Reserved.