public class PageDTO<T> extends Object implements Pageable<T>, Serializable
该类为分页DTO, Pageable 的默认实现, 用于项目中所有分页相关功能数据传输, 原则上所有分页相关功能均使用此类
| 构造器和说明 |
|---|
PageDTO()
构造器
|
PageDTO(int pageNo,
int pageSize)
构造器
|
PageDTO(int pageNo,
int pageSize,
long totalCount,
Collection<T> content)
构造器
|
PageDTO(PageDetailVO pageDetailVO,
Collection<T> content)
构造器
|
PageDTO(PageRequest pageRequest)
构造器
|
PageDTO(PageRequest pageRequest,
long totalCount,
Collection<T> content)
构造器
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
adjustPageNo()
调整页码,使不超过最大页数
|
static <T> PageDTO<T> |
empty()
获取空分页DTO
|
Collection<T> |
getContent()
获取分页数据
|
int |
getNextPage()
返回下页的页号
|
int |
getPageNo()
页码
|
int |
getPageSize()
每页记录数
|
int |
getPrePage()
返回上页的页号
|
long |
getTotalCount()
总记录数
|
int |
getTotalPage()
总页数
|
boolean |
isFirstPage()
是否第一页
|
boolean |
isLastPage()
是否最后一页
|
PageDTO<T> |
setContent(Collection<T> content) |
PageDTO<T> |
setPageNo(int pageNo) |
PageDTO<T> |
setPageSize(int pageSize) |
PageDTO<T> |
setTotalCount(long totalCount) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitconvertToPageDetailVO, formatEndDate, offsetPageNopublic PageDTO()
public PageDTO(int pageNo,
int pageSize)
pageNo - 页码pageSize - 每页数量public PageDTO(int pageNo,
int pageSize,
long totalCount,
Collection<T> content)
pageNo - 页码pageSize - 每页数量totalCount - 总数content - 数据public PageDTO(PageRequest pageRequest)
pageRequest - 分页参数public PageDTO(PageRequest pageRequest, long totalCount, Collection<T> content)
pageRequest - 分页参数content - 数据totalCount - 总数public PageDTO(PageDetailVO pageDetailVO, Collection<T> content)
pageDetailVO - 分页详情content - 数据public static <T> PageDTO<T> empty()
T - 分页数据类型public long getTotalCount()
PageablegetTotalCount 在接口中 Pageable<T>public int getPageSize()
PageablegetPageSize 在接口中 Pageable<T>public int getTotalPage()
PageablegetTotalPage 在接口中 Pageable<T>public boolean isFirstPage()
PageableisFirstPage 在接口中 Pageable<T>public boolean isLastPage()
PageableisLastPage 在接口中 Pageable<T>public int getNextPage()
PageablegetNextPage 在接口中 Pageable<T>public int getPrePage()
PageablegetPrePage 在接口中 Pageable<T>public Collection<T> getContent()
PageablegetContent 在接口中 Pageable<T>public PageDTO<T> setContent(Collection<T> content)
public void adjustPageNo()
Copyright © 2021 HaiChuang Inc.. All rights reserved.