在开发中我们经常会用到的分页实体类,这里封装一个简单的分页实体类
package com.xxx.xxx.page;
import java.util.List;
import java.util.Objects;
public class PageInfo<T> {
private Long currentPage = 1L;
private Long pageSize = 10L;
private Long totalPage;
private Long totalCount;
private List<T> records;
public PageInfo() {
}
public PageInfo(Long currentPage, Long pageSize) {
this.currentPage = currentPage;
this.pageSize = pageSize;
}
public PageInfo(Long currentPage, Long pageSize, Long totalPage, Long totalCount, List<T> records) {
this.currentPage = currentPage;
this.pageSize = pageSize;
this.totalPage = totalPage;
this.totalCount = totalCount;
this.records = records;
}
public Long getCurrentPage() {
return Objects.isNull(currentPage) ? 1L : this.currentPage;
}
public Long getPageSize() {