Pagination is done via the request builders. Available methods will allow for #limit, #count, #offset.
#limit
#count
#offset
Here is an example of paginating through projects.
HangarClient client = HangarClient.builder().auth(new JWTAuthProvider("<TOKEN>")).build(); ProjectsResponse initialResponse = client.retrieveProjects().execute().join(); int count = initialResponse.getCount(); int limit = initialResponse.getLimit(); int pages = (int) Math.ceil((double) count / limit); for (int i = 0; i < pages; i++) { int offset = i * limit; ProjectsResponse response = client.retrieveProjects().offset(offset).execute().join(); List<Project> projects = response.getProjects(); for (Project project : projects) { System.out.println("project: " + project.getName()); } }
There was an error while loading. Please reload this page.