package com.rockalltech.common.dao.delegates; /** * Pagination location is a value object design pattern for holding the current * location within the result set and also providing some basic information * about whether there is more to show etc. * * The idea is that is can be used to hold information about the pagination for * pagination aware objects, and also helpful for view layer operations (i.e. * should I show a button for next) * */ public class PaginationLocation { private int currentPage; private boolean moreResultsAvailable; public int getCurrentPage() { return currentPage; } public boolean isFirstPage() { return (currentPage == 0); } public boolean isMoreResultsAvailable() { return moreResultsAvailable; } public void setCurrentPage(int currentPage) { this.currentPage = currentPage; } public void setMoreResultsAvailable(boolean moreResultsAvailable) { this.moreResultsAvailable = moreResultsAvailable; } }