net.jrouter.paging.ibatis.NoOpRowBounds Maven / Gradle / Ivy
package net.jrouter.paging.ibatis;
import java.util.Collections;
import java.util.List;
import net.jrouter.paging.component.Page;
/**
* 无操作{@code AbstractRowBounds}的实现类;查询已知偏移量的数据集合。
*/
public class NoOpRowBounds extends AbstractRowBounds {
private static final Page NO_PAGE = new Page() {
@Override
public int getPageNumber() {
return 1;
}
@Override
public int getPageSize() {
return Integer.MAX_VALUE;
}
@Override
public boolean isAutoCount() {
return false;
}
@Override
public int getTotalPages() {
return 1;
}
@Override
public int getMaxResults() {
return Integer.MAX_VALUE;
}
@Override
public void countTotalElements(long totalElements) {
}
@Override
public void setContent(List content) {
}
@Override
public List getContent() {
return Collections.EMPTY_LIST;
}
};
public NoOpRowBounds() {
super();
}
public NoOpRowBounds(int offset, int limit) {
super(offset, limit);
}
@Override
public Page getPage() {
return NO_PAGE;
}
}