Rename methods for better clarity

This commit is contained in:
Liam Newman
2019-12-17 12:41:23 -08:00
parent 40f05e4dbb
commit 305267d07f
60 changed files with 471 additions and 395 deletions

View File

@@ -87,7 +87,7 @@ public class GHRepositoryStatistics {
* This gets the actual statistics from the server. Returns null if they are still being cached.
*/
private PagedIterable<ContributorStats> getContributorStatsImpl() throws IOException {
return root.retrieve()
return root.createRequest()
.asPagedIterable(getApiTailUrl("contributors"), ContributorStats[].class, item -> item.wrapUp(root));
}
@@ -243,7 +243,7 @@ public class GHRepositoryStatistics {
* the io exception
*/
public PagedIterable<CommitActivity> getCommitActivity() throws IOException {
return root.retrieve()
return root.createRequest()
.asPagedIterable(getApiTailUrl("commit_activity"), CommitActivity[].class, item -> item.wrapUp(root));
}
@@ -318,7 +318,7 @@ public class GHRepositoryStatistics {
// Map to ArrayLists first, since there are no field names in the
// returned JSON.
try {
InputStream stream = root.retrieve().withUrlPath(getApiTailUrl("code_frequency")).toStream();
InputStream stream = root.createRequest().withUrlPath(getApiTailUrl("code_frequency")).fetchStream();
ObjectMapper mapper = new ObjectMapper();
TypeReference<ArrayList<ArrayList<Integer>>> typeRef = new TypeReference<ArrayList<ArrayList<Integer>>>() {
@@ -400,7 +400,7 @@ public class GHRepositoryStatistics {
* the io exception
*/
public Participation getParticipation() throws IOException {
return root.retrieve().withUrlPath(getApiTailUrl("participation")).to(Participation.class);
return root.createRequest().withUrlPath(getApiTailUrl("participation")).fetch(Participation.class);
}
/**
@@ -460,7 +460,7 @@ public class GHRepositoryStatistics {
public List<PunchCardItem> getPunchCard() throws IOException {
// Map to ArrayLists first, since there are no field names in the
// returned JSON.
InputStream stream = root.retrieve().withUrlPath(getApiTailUrl("punch_card")).toStream();
InputStream stream = root.createRequest().withUrlPath(getApiTailUrl("punch_card")).fetchStream();
ObjectMapper mapper = new ObjectMapper();
TypeReference<ArrayList<ArrayList<Integer>>> typeRef = new TypeReference<ArrayList<ArrayList<Integer>>>() {