Skip to content

Commit

Permalink
Reverted more stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-mclawhorn committed Nov 1, 2018
1 parent 8b12afc commit 9b15fa5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public AllPagesPagination(Collection<T> entireCollection, PaginationParameters p
this.collectionSize = entireCollection.size();
this.pageToFetch = paginationParameters.getPage(entireCollection.size());
this.countPerPage = paginationParameters.getPerPage();
this.lastPage = (collectionSize > countPerPage) ? ((collectionSize - 1) / countPerPage + 1) : 1;
this.lastPage = (collectionSize > countPerPage) ? (collectionSize - 1) / countPerPage + 1 : 1;

if (this.pageToFetch > this.lastPage || this.pageToFetch < FIRST_PAGE) {
throw new PageNotFoundException(this.pageToFetch, this.countPerPage, lastPage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public SinglePagePagination(List<T> entirePage, PaginationParameters paginationP
this.pageToFetch = paginationParameters.getPage(entirePage.size());
this.countPerPage = paginationParameters.getPerPage();
this.totalMatch = totalMatch;
this.lastPage = (totalMatch > countPerPage) ? (int) (totalMatch - 1) / countPerPage + 1 : 1;
this.lastPage = (totalMatch > countPerPage) ? (totalMatch - 1) / countPerPage + 1 : 1;

if (this.pageToFetch > this.lastPage || this.pageToFetch < FIRST_PAGE) {
throw new PageNotFoundException(this.pageToFetch, this.countPerPage, lastPage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
*/
public class PageNotFoundException extends RuntimeException {

private final long page;
private final long rowsPerPage;
private final long lastPage;
private final int page;
private final int rowsPerPage;
private final int lastPage;

/**
* Constructor.
Expand All @@ -23,7 +23,7 @@ public class PageNotFoundException extends RuntimeException {
* @param rowsPerPage Page size
* @param lastPage Terminal page available
*/
public PageNotFoundException(long page, long rowsPerPage, long lastPage) {
public PageNotFoundException(int page, int rowsPerPage, int lastPage) {
this.page = page;
this.rowsPerPage = rowsPerPage;
this.lastPage = lastPage;
Expand Down

0 comments on commit 9b15fa5

Please sign in to comment.