Class Pager<T>

java.lang.Object
org.aoju.bus.gitlab.Pager<T>
Type Parameters:
T - the GitLab4J type contained in the List.
All Implemented Interfaces:
Iterator<List<T>>, Constants

public class Pager<T> extends Object implements Iterator<List<T>>, Constants

This class defines an Iterator implementation that is used as a paging iterator for all API methods that return a List of objects. It hides the details of interacting with the GitLab API when paging is involved simplifying accessing large lists of objects.

Example usage:

   // Get a Pager instance that will page through the projects with 10 projects per page
   Pager<Project> projectPager = gitlabApi.getProjectsApi().getProjectsPager(10);

   // Iterate through the pages and print out the name and description
   while (projectsPager.hasNext())) {
       List<Project> projects = projectsPager.next();
       for (Project project : projects) {
           System.out.println(project.getName() + " : " + project.getDescription());
       }
   }