mirror of
https://github.com/jlengrand/github-api.git
synced 2026-03-22 00:11:26 +00:00
Simplify creation of PagedIterables from requests
This commit is contained in:
@@ -98,17 +98,11 @@ public class GHCommitComment extends GHObject implements Reactable {
|
||||
|
||||
@Preview @Deprecated
|
||||
public PagedIterable<GHReaction> listReactions() {
|
||||
return new PagedIterable<GHReaction>() {
|
||||
public PagedIterator<GHReaction> _iterator(int pageSize) {
|
||||
return new PagedIterator<GHReaction>(owner.root.retrieve().withPreview(SQUIRREL_GIRL).asIterator(getApiTail()+"/reactions", GHReaction[].class, pageSize)) {
|
||||
@Override
|
||||
protected void wrapUp(GHReaction[] page) {
|
||||
for (GHReaction c : page)
|
||||
c.wrap(owner.root);
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
return owner.root.retrieve().withPreview(SQUIRREL_GIRL)
|
||||
.asPagedIterable(
|
||||
getApiTail()+"/reactions",
|
||||
GHReaction[].class,
|
||||
item -> item.wrap(owner.root) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user