@Override protected List<GithubComment> executeServiceSync(RestAdapter restAdapter) { GistsService gistsService = restAdapter.create(GistsService.class); List<GithubComment> comments = new ArrayList<>(); comments.addAll(gistsService.comments(id, 1)); for (int i = nextPage; i < lastPage; i++) comments.addAll(gistsService.comments(id, i)); return comments; }
@Override protected void executePaginated(int nextPage) { service.comments(id, nextPage, this); }
@Override public void execute() { service.comments(id, this); }