mirror of
https://github.com/jlengrand/github-api.git
synced 2026-04-04 08:21:23 +00:00
Remove fetchArray method
This commit is contained in:
@@ -69,7 +69,10 @@ public class GHMyself extends GHUser {
|
||||
* the io exception
|
||||
*/
|
||||
public List<GHEmail> getEmails2() throws IOException {
|
||||
GHEmail[] addresses = root.createRequest().withUrlPath("/user/emails").fetchArray(GHEmail[].class);
|
||||
GHEmail[] addresses = root.createRequest()
|
||||
.withUrlPath("/user/emails")
|
||||
.toIterable(GHEmail[].class, null)
|
||||
.toArray();
|
||||
return Collections.unmodifiableList(Arrays.asList(addresses));
|
||||
}
|
||||
|
||||
@@ -84,8 +87,8 @@ public class GHMyself extends GHUser {
|
||||
* the io exception
|
||||
*/
|
||||
public List<GHKey> getPublicKeys() throws IOException {
|
||||
return Collections.unmodifiableList(
|
||||
Arrays.asList(root.createRequest().withUrlPath("/user/keys").fetchArray(GHKey[].class)));
|
||||
return Collections.unmodifiableList(Arrays
|
||||
.asList(root.createRequest().withUrlPath("/user/keys").toIterable(GHKey[].class, null).toArray()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -99,8 +102,10 @@ public class GHMyself extends GHUser {
|
||||
* the io exception
|
||||
*/
|
||||
public List<GHVerifiedKey> getPublicVerifiedKeys() throws IOException {
|
||||
return Collections.unmodifiableList(Arrays.asList(
|
||||
root.createRequest().withUrlPath("/users/" + getLogin() + "/keys").fetchArray(GHVerifiedKey[].class)));
|
||||
return Collections.unmodifiableList(Arrays.asList(root.createRequest()
|
||||
.withUrlPath("/users/" + getLogin() + "/keys")
|
||||
.toIterable(GHVerifiedKey[].class, null)
|
||||
.toArray()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -113,7 +118,10 @@ public class GHMyself extends GHUser {
|
||||
public GHPersonSet<GHOrganization> getAllOrganizations() throws IOException {
|
||||
GHPersonSet<GHOrganization> orgs = new GHPersonSet<GHOrganization>();
|
||||
Set<String> names = new HashSet<String>();
|
||||
for (GHOrganization o : root.createRequest().withUrlPath("/user/orgs").fetchArray(GHOrganization[].class)) {
|
||||
for (GHOrganization o : root.createRequest()
|
||||
.withUrlPath("/user/orgs")
|
||||
.toIterable(GHOrganization[].class, null)
|
||||
.toArray()) {
|
||||
if (names.add(o.getLogin())) // in case of rumoured duplicates in the data
|
||||
orgs.add(root.getOrganization(o.getLogin()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user