package com.iformall.domain.vo.invest;

import lombok.Data;

import java.util.Collection;
import java.util.Collections;

@Data
public class InvestPageResult<T> {

	/**
	 * 查询数据列表
	 */
	private Collection<T> records = Collections.emptyList();
	/**
	 * 总数
	 */
	private long total = 0;
	/**
	 * 每页显示条数，默认 10
	 */
	private long size = 10;
	/**
	 * 当前页
	 */
	private long current = 1;

	private boolean hasNextPage = false ;

	public Collection<T> getRecords() {
		return records;
	}

	public void setRecords(Collection<T> records) {
		this.records = records;
		if (total > (records.size() + (current-1) * size)) {
			hasNextPage = true;
		}
	}
}
