perPage can be changed, but this doesn't affect the page number. This is a little funny, because if I get 20 items on the first page, and then a second page of 100 items, I'll miss items 21-80. It seems more sensible to have Pagination take perPage as a constructor argument.
One must manually increment the page number when querying. Instead, methods that take a pagination could increment the page number before returning, allowing the method to be called multiple times without any additional steps. Or, as another option, methods wanting pagination could be moved into the Pagination object and do the increment internally.
https://github.com/timols/java-gitlab-api/blob/27eb69ba671be2da8e1a5fe75fac6be2bf035e4c/src/main/java/org/gitlab/api/Pagination.java#L15 this calls "append", so if you call setPage twice, you'll get ?page=4&page=5. If one is lucky, gitlab would choose the latter of these, but I have no idea what it actually does.
perPage can be changed, but this doesn't affect the page number. This is a little funny, because if I get 20 items on the first page, and then a second page of 100 items, I'll miss items 21-80. It seems more sensible to have Pagination take perPage as a constructor argument.
One must manually increment the page number when querying. Instead, methods that take a pagination could increment the page number before returning, allowing the method to be called multiple times without any additional steps. Or, as another option, methods wanting pagination could be moved into the Pagination object and do the increment internally.