Merge branch 'feature/REQ-2545' into test
This commit is contained in:
commit
5272e410c1
@ -25,4 +25,22 @@ public class PageResp<T> {
|
||||
public List<T> getData() {
|
||||
return Optional.ofNullable(data).orElse(ImmutableList.of());
|
||||
}
|
||||
|
||||
public boolean hasNext() {
|
||||
return this.current < this.getPages();
|
||||
}
|
||||
|
||||
public long getPages() {
|
||||
if (this.getSize() == 0L) {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
|
||||
long pages = this.getTotal() / this.getSize();
|
||||
if (this.getTotal() % this.getSize() != 0L) {
|
||||
++pages;
|
||||
}
|
||||
return pages;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user