I’m having trouble understanding how to work with pagination with the Java client. I followed the instructions on Java and set up the Maven dependency for version 0.10.1.
I’m able to get a list of tasks for a project with:
List projectTasks = client.tasks.getTasksForProject(myProject.gid, null, null, null, true)
.option(“pretty”, true)
.execute();
The issue is that I don’t know how to get the “nextPage” or “offset” data that I’m sure is somewhere in the response.
I tried changing the return type from client.tasks.getTasksForProject to:
CollectionRequest projectTasks = client.tasks.getTasksForProject(myProject.gid, null, null, null, true).option(“pretty”, true).execute();
But then I get a compilation error that CollectionRequest is not a return type for that call.
I looked at this post Pagination in Java client and ResultBodyCollection gives me the same compilation error. Only a List is returned from the client.tasks.getTasksForProject call. And when I try to get nextPage from the List object it also gives a compilation error.
Is there an updated version of the Maven dependency? Is there a different object that I should be casting the return to? Is there another way to get nextPage and offset with the version I have?
Thanks for any help!