net.jrouter.paging.ibatis.PageRowBounds Maven / Gradle / Ivy
package net.jrouter.paging.ibatis;
import net.jrouter.paging.component.Page;
/**
* {@code AbstractRowBounds}实现类。
*/
public final class PageRowBounds extends AbstractRowBounds {
/**
* 分页对象。
*/
@lombok.Getter
private final Page page;
private PageRowBounds(Page page) {
super((int) Math.min(Integer.MAX_VALUE, 1l * (page.getPageNumber() - 1) * page.getPageSize()), page.getMaxResults());
this.page = page;
}
public static PageRowBounds build(Page page) {
return new PageRowBounds(page);
}
}