Skip to content

Commit

Permalink
add a filter param to the get members method
Browse files Browse the repository at this point in the history
  • Loading branch information
lindseydew committed Feb 11, 2014
1 parent fee02a3 commit 628034a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/java/org/kohsuke/github/GHOrganization.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,22 @@ public void publicize(GHUser u) throws IOException {
* All the members of this organization.
*/
public PagedIterable<GHUser> getMembers() throws IOException {
return getMembersWithFilter(null);
}

public PagedIterable<GHUser> getMembersWithFilter(final String filter) throws IOException {

return new PagedIterable<GHUser>() {
public PagedIterator<GHUser> iterator() {
return new PagedIterator<GHUser>(root.retrieve().asIterator(String.format("/orgs/%s/members", login), GHUser[].class)) {
String filterParams = (filter == null) ? "" : ("?filter=" + filter);
return new PagedIterator<GHUser>(root.retrieve().asIterator(String.format("/orgs/%s/members%s", login, filterParams), GHUser[].class)) {
@Override
protected void wrapUp(GHUser[] page) {
}
};
}
};
}

/**
* Conceals the membership.
*/
Expand Down

0 comments on commit 628034a

Please sign in to comment.