Skip to content

Commit 024cb8f

Browse files
committed
Rename
1 parent 78d1a9e commit 024cb8f

19 files changed

+128
-157
lines changed

src/main/java/org/kohsuke/github/GHAppInstallation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ public PagedSearchIterable<GHRepository> listRepositories() {
267267

268268
request = root().createRequest().withUrlPath("/installation/repositories").build();
269269

270-
return new PagedSearchIterable<>(new GitHubEndpointIterable<>(root()
270+
return new PagedSearchIterable<>(new PaginatedEndpoint<>(root()
271271
.getClient(), request, GHAppInstallationRepositoryResult.class, GHRepository.class, null));
272272
}
273273
}

src/main/java/org/kohsuke/github/GHAppInstallationsIterable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class GHAppInstallationsIterable extends PagedIterable<GHAppInstallation> {
1616
* the root
1717
*/
1818
public GHAppInstallationsIterable(GitHub root) {
19-
super(new GitHubEndpointIterable<>(root.getClient(),
19+
super(new PaginatedEndpoint<>(root.getClient(),
2020
root.createRequest().withUrlPath(APP_INSTALLATIONS_URL).build(),
2121
GHAppInstallationsPage.class,
2222
GHAppInstallation.class,

src/main/java/org/kohsuke/github/GHArtifactsIterable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class GHArtifactsIterable extends PagedIterable<GHArtifact> {
1515
* the request builder
1616
*/
1717
public GHArtifactsIterable(GHRepository owner, GitHubRequest.Builder<?> requestBuilder) {
18-
super(new GitHubEndpointIterable<>(owner.root().getClient(),
18+
super(new PaginatedEndpoint<>(owner.root().getClient(),
1919
requestBuilder.build(),
2020
GHArtifactsPage.class,
2121
GHArtifact.class,

src/main/java/org/kohsuke/github/GHAuthenticatedAppInstallation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public PagedSearchIterable<GHRepository> listRepositories() {
3939

4040
request = root().createRequest().withUrlPath("/installation/repositories").build();
4141

42-
return new PagedSearchIterable<>(new GitHubEndpointIterable<>(root()
42+
return new PagedSearchIterable<>(new PaginatedEndpoint<>(root()
4343
.getClient(), request, GHAuthenticatedAppInstallationRepositoryResult.class, GHRepository.class, null));
4444
}
4545

src/main/java/org/kohsuke/github/GHCheckRunsIterable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class GHCheckRunsIterable extends PagedIterable<GHCheckRun> {
1414
* the request
1515
*/
1616
public GHCheckRunsIterable(GHRepository owner, GitHubRequest request) {
17-
super(new GitHubEndpointIterable<>(owner.root()
17+
super(new PaginatedEndpoint<>(owner.root()
1818
.getClient(), request, GHCheckRunsPage.class, GHCheckRun.class, item -> item.wrap(owner)));
1919
}
2020
}

src/main/java/org/kohsuke/github/GHCommitFileIterable.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ class GHCommitFileIterable extends PagedIterable<GHCommit.File> {
1717
*/
1818
private static final int GH_FILE_LIMIT_PER_COMMIT_PAGE = 300;
1919

20-
private static GitHubEndpointIterable<GHCommitFilesPage, File> createEndpointIterable(GHRepository owner,
20+
private static PaginatedEndpoint<GHCommitFilesPage, File> createEndpointIterable(GHRepository owner,
2121
String sha,
2222
GHCommit.File[] files) {
23-
GitHubEndpointIterable<GHCommitFilesPage, File> iterable;
23+
PaginatedEndpoint<GHCommitFilesPage, File> iterable;
2424
if (files != null && files.length < GH_FILE_LIMIT_PER_COMMIT_PAGE) {
2525
// create a page iterator that only provides one page
26-
iterable = GitHubEndpointIterable.ofSingleton(new GHCommitFilesPage(files));
26+
iterable = PaginatedEndpoint.ofSingleton(new GHCommitFilesPage(files));
2727
} else {
2828
GitHubRequest request = owner.root()
2929
.createRequest()
3030
.withUrlPath(owner.getApiTailUrl("commits/" + sha))
3131
.build();
32-
iterable = new GitHubEndpointIterable<>(owner.root()
32+
iterable = new PaginatedEndpoint<>(owner.root()
3333
.getClient(), request, GHCommitFilesPage.class, GHCommit.File.class, null);
3434
}
3535
return iterable;

src/main/java/org/kohsuke/github/GHCompare.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ public PagedIterable<Commit> listCommits() {
345345
.withPageSize(10);
346346
} else {
347347
// if not using paginated commits, adapt the returned commits array
348-
return new PagedIterable<>(GitHubEndpointIterable.ofSingleton(this.commits));
348+
return new PagedIterable<>(PaginatedEndpoint.ofSingleton(this.commits));
349349
}
350350
}
351351

src/main/java/org/kohsuke/github/GHExternalGroupIterable.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ class GHExternalGroupIterable extends PagedIterable<GHExternalGroup> {
1818
* the request builder
1919
*/
2020
GHExternalGroupIterable(final GHOrganization owner, GitHubRequest.Builder<?> requestBuilder) {
21-
super(new GitHubEndpointIterable<>(owner.root().getClient(),
21+
super(new PaginatedEndpoint<>(owner.root().getClient(),
2222
requestBuilder.build(),
2323
GHExternalGroupPage.class,
2424
GHExternalGroup.class,
2525
item -> item.wrapUp(owner)) {
2626
@NotNull @Override
27-
public GitHubEndpointPageIterator<GHExternalGroupPage, GHExternalGroup> pageIterator() {
28-
return new GitHubEndpointPageIterator<>(client, pageType, request, pageSize, itemInitializer) {
27+
public PaginatedEndpointPages<GHExternalGroupPage, GHExternalGroup> pages() {
28+
return new PaginatedEndpointPages<>(client, pageType, request, pageSize, itemInitializer) {
2929
@Override
3030
public boolean hasNext() {
3131
try {

src/main/java/org/kohsuke/github/GHSearchBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ PagedSearchIterable<T> list(Consumer<T> itemInitializer) {
7777

7878
req.set("q", StringUtils.join(terms, " "));
7979
return new PagedSearchIterable<>(
80-
new GitHubEndpointIterable<>(root().getClient(), req.build(), receiverType, itemType, itemInitializer));
80+
new PaginatedEndpoint<>(root().getClient(), req.build(), receiverType, itemType, itemInitializer));
8181
}
8282

8383
/**

src/main/java/org/kohsuke/github/GHWorkflowJobsIterable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class GHWorkflowJobsIterable extends PagedIterable<GHWorkflowJob> {
1616
* the request
1717
*/
1818
public GHWorkflowJobsIterable(GHRepository repo, GitHubRequest request) {
19-
super(new GitHubEndpointIterable<>(repo.root()
19+
super(new PaginatedEndpoint<>(repo.root()
2020
.getClient(), request, GHWorkflowJobsPage.class, GHWorkflowJob.class, item -> item.wrapUp(repo)));
2121
}
2222
}

src/main/java/org/kohsuke/github/GHWorkflowRunsIterable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class GHWorkflowRunsIterable extends PagedIterable<GHWorkflowRun> {
1414
* the request builder
1515
*/
1616
public GHWorkflowRunsIterable(GHRepository owner, GitHubRequest.Builder<?> requestBuilder) {
17-
super(new GitHubEndpointIterable<>(owner.root().getClient(),
17+
super(new PaginatedEndpoint<>(owner.root().getClient(),
1818
requestBuilder.build(),
1919
GHWorkflowRunsPage.class,
2020
GHWorkflowRun.class,

src/main/java/org/kohsuke/github/GHWorkflowsIterable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class GHWorkflowsIterable extends PagedIterable<GHWorkflow> {
1313
* the owner
1414
*/
1515
public GHWorkflowsIterable(GHRepository owner) {
16-
super(new GitHubEndpointIterable<>(owner.root().getClient(),
16+
super(new PaginatedEndpoint<>(owner.root().getClient(),
1717
owner.root().createRequest().withUrlPath(owner.getApiTailUrl("actions/workflows")).build(),
1818
GHWorkflowsPage.class,
1919
GHWorkflow.class,

src/main/java/org/kohsuke/github/PagedIterable.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
*/
1818
public class PagedIterable<T> implements Iterable<T> {
1919

20-
private final GitHubEndpointIterable<?, T> paginatedEndpoint;
20+
private final PaginatedEndpoint<?, T> paginatedEndpoint;
2121

2222
/**
2323
* Instantiates a new git hub page contents iterable.
2424
*/
25-
PagedIterable(GitHubEndpointIterable<?, T> paginatedEndpoint) {
25+
PagedIterable(PaginatedEndpoint<?, T> paginatedEndpoint) {
2626
this.paginatedEndpoint = paginatedEndpoint;
2727
}
2828

@@ -32,7 +32,7 @@ public PagedIterator<T> _iterator(int pageSize) {
3232

3333
@Nonnull
3434
public final PagedIterator<T> iterator() {
35-
return new PagedIterator<>(paginatedEndpoint.itemIterator());
35+
return new PagedIterator<>(paginatedEndpoint.items());
3636
}
3737

3838
@Nonnull

src/main/java/org/kohsuke/github/PagedIterator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@
1919
*/
2020
public class PagedIterator<T> implements Iterator<T> {
2121

22-
private final GitHubPageItemIterator<?, T> endpointIterator;
22+
private final PaginatedEndpointItems<?, T> endpointIterator;
2323

2424
/**
2525
* Instantiates a new paged iterator.
2626
*
2727
* @param endpointIterator
2828
* the base
2929
*/
30-
PagedIterator(GitHubPageItemIterator<?, T> endpointIterator) {
30+
PagedIterator(PaginatedEndpointItems<?, T> endpointIterator) {
3131
this.endpointIterator = endpointIterator;
3232
}
3333

src/main/java/org/kohsuke/github/PagedSearchIterable.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
justification = "Constructed by JSON API")
1717
public class PagedSearchIterable<T> extends PagedIterable<T> {
1818

19-
private final GitHubEndpointIterable<? extends SearchResult<T>, T> paginatedEndpoint;
19+
private final PaginatedEndpoint<? extends SearchResult<T>, T> paginatedEndpoint;
2020

2121
/**
2222
* Instantiates a new git hub page contents iterable.
2323
*/
24-
<Result extends SearchResult<T>> PagedSearchIterable(GitHubEndpointIterable<Result, T> paginatedEndpoint) {
24+
<Result extends SearchResult<T>> PagedSearchIterable(PaginatedEndpoint<Result, T> paginatedEndpoint) {
2525
super(paginatedEndpoint);
2626
this.paginatedEndpoint = paginatedEndpoint;
2727
}
@@ -33,7 +33,7 @@ <Result extends SearchResult<T>> PagedSearchIterable(GitHubEndpointIterable<Resu
3333
*/
3434
public int getTotalCount() {
3535
// populate();
36-
return paginatedEndpoint.pageIterator().peek().totalCount;
36+
return paginatedEndpoint.pages().peek().totalCount;
3737
}
3838

3939
/**
@@ -43,6 +43,6 @@ public int getTotalCount() {
4343
*/
4444
public boolean isIncomplete() {
4545
// populate();
46-
return paginatedEndpoint.pageIterator().peek().incompleteResults;
46+
return paginatedEndpoint.pages().peek().incompleteResults;
4747
}
4848
}

0 commit comments

Comments
 (0)