You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
webcrawler/db/src/main/java/db/form/PageResult.java

104 lines
1.6 KiB

package db.form;
import db.model.AbstractModel;
import java.util.List;
/**
* 分页数据实体
* @param <T>
*/
public class PageResult<T extends AbstractModel> {
/**
* 总记录数
*/
private long count;
/**
* 当前页数
*/
private int currentPage;
/**
* 数据实体集合
*/
private List<T> datas;
/**
* 分页大小
*/
private int pageSize;
/**
* 分页数
*/
private long pages;
/**
* 返回结果
*/
private Type type;
/**
* 错误信息
*/
private String errorMsg;
public long getCount() {
return count;
}
public void setCount(long count) {
this.count = count;
}
public int getCurrentPage() {
return currentPage;
}
public void setCurrentPage(int currentPage) {
this.currentPage = currentPage;
}
public List<T> getDatas() {
return datas;
}
public void setDatas(List<T> datas) {
this.datas = datas;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public long getPages() {
return pages;
}
public void setPages() {
this.pages = count%pageSize==0?count/pageSize:count/pageSize+1;
}
public Type getType() {
return type;
}
public void setType(Type type) {
this.type = type;
}
public String getErrorMsg() {
return errorMsg;
}
public void setErrorMsg(String errorMsg) {
this.errorMsg = errorMsg;
}
}