mirror of
https://github.com/jlengrand/github-api.git
synced 2026-04-04 15:50:52 +00:00
Comments are paged
This commit is contained in:
committed by
Honza Brázdil
parent
c268a5dd07
commit
cc3793cbcd
@@ -157,11 +157,17 @@ public class GHIssue {
|
||||
/**
|
||||
* Obtains all the comments associated with this issue.
|
||||
*/
|
||||
public List<GHIssueComment> getComments() throws IOException {
|
||||
GHIssueComment[] r = root.retrieve(getApiRoute() + "/comments", GHIssueComment[].class);
|
||||
for (GHIssueComment c : r)
|
||||
c.wrapUp(this);
|
||||
return Arrays.asList(r);
|
||||
public PagedIterable<GHIssueComment> getComments() throws IOException {
|
||||
return new PagedIterable<GHIssueComment>() {
|
||||
public PagedIterator<GHIssueComment> iterator() {
|
||||
return new PagedIterator<GHIssueComment>(root.retrievePaged(getApiRoute() + "/comments",GHIssueComment[].class,false)) {
|
||||
protected void wrapUp(GHIssueComment[] page) {
|
||||
for (GHIssueComment c : page)
|
||||
c.wrapUp(GHIssue.this);
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private String getApiRoute() {
|
||||
|
||||
Reference in New Issue
Block a user