Package org.kohsuke.github
Class GHUser
- java.lang.Object
-
- org.kohsuke.github.GHObject
-
- org.kohsuke.github.GHPerson
-
- org.kohsuke.github.GHUser
-
- Direct Known Subclasses:
GHMyself
,GHRepository.Contributor
public class GHUser extends GHPerson
Represents an user of GitHub.- Author:
- Kohsuke Kawaguchi
-
-
Field Summary
-
Fields inherited from class org.kohsuke.github.GHPerson
avatar_url, bio, blog, company, email, followers, following, hireable, html_url, location, login, name, public_gists, public_repos, site_admin, total_private_repos, twitter_username, type
-
Fields inherited from class org.kohsuke.github.GHObject
responseHeaderFields
-
-
Constructor Summary
Constructors Constructor Description GHUser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
void
follow()
Follow this user.String
getBio()
GHPersonSet<GHUser>
getFollowers()
Lists the users who are following this user.GHPersonSet<GHUser>
getFollows()
Lists the users that this user is followingList<GHKey>
getKeys()
Gets keys.GHPersonSet<GHOrganization>
getOrganizations()
Gets the organization that this user belongs to publicly.int
hashCode()
boolean
isHireable()
Returns true if this user is marked as hireable, false otherwiseboolean
isMemberOf(GHOrganization org)
Returns true if this user belongs to the specified organization.boolean
isMemberOf(GHTeam team)
Returns true if this user belongs to the specified team.boolean
isPublicMemberOf(GHOrganization org)
Returns true if this user belongs to the specified organization as a public member.PagedIterable<GHEventInfo>
listEvents()
Lists events performed by a user (this includes private events if the caller is authenticated.PagedIterable<GHUser>
listFollowers()
Lists the users who are following this user.PagedIterable<GHUser>
listFollows()
Lists the users that this user is followingPagedIterable<GHGist>
listGists()
Lists Gists created by this user.PagedIterable<GHRepository>
listStarredRepositories()
Lists all the repositories that this user has starred.PagedIterable<GHRepository>
listSubscriptions()
Lists all the subscribed (aka watched) repositories.void
unfollow()
Unfollow this user.-
Methods inherited from class org.kohsuke.github.GHPerson
getAvatarUrl, getBlog, getCompany, getCreatedAt, getEmail, getFollowersCount, getFollowingCount, getGravatarId, getHtmlUrl, getLocation, getLogin, getName, getPublicGistCount, getPublicRepoCount, getRepositories, getRepository, getTotalPrivateRepoCount, getTwitterUsername, getType, getUpdatedAt, isSiteAdmin, iterateRepositories, listRepositories, listRepositories, populate
-
Methods inherited from class org.kohsuke.github.GHObject
getId, getNodeId, getResponseHeaderFields, getUrl, setResponseHeaderFields, toString
-
-
-
-
Method Detail
-
getKeys
public List<GHKey> getKeys() throws IOException
Gets keys.- Returns:
- the keys
- Throws:
IOException
- the io exception
-
follow
public void follow() throws IOException
Follow this user.- Throws:
IOException
- the io exception
-
unfollow
public void unfollow() throws IOException
Unfollow this user.- Throws:
IOException
- the io exception
-
getFollows
@WithBridgeMethods(java.util.Set.class) public GHPersonSet<GHUser> getFollows() throws IOException
Lists the users that this user is following- Returns:
- the follows
- Throws:
IOException
- the io exception
-
listFollows
public PagedIterable<GHUser> listFollows()
Lists the users that this user is following- Returns:
- the paged iterable
-
getFollowers
@WithBridgeMethods(java.util.Set.class) public GHPersonSet<GHUser> getFollowers() throws IOException
Lists the users who are following this user.- Returns:
- the followers
- Throws:
IOException
- the io exception
-
listFollowers
public PagedIterable<GHUser> listFollowers()
Lists the users who are following this user.- Returns:
- the paged iterable
-
listSubscriptions
public PagedIterable<GHRepository> listSubscriptions()
Lists all the subscribed (aka watched) repositories.https://developer.github.com/v3/activity/watching/
- Returns:
- the paged iterable
-
listStarredRepositories
public PagedIterable<GHRepository> listStarredRepositories()
Lists all the repositories that this user has starred.- Returns:
- the paged iterable
-
isMemberOf
public boolean isMemberOf(GHOrganization org)
Returns true if this user belongs to the specified organization.- Parameters:
org
- the org- Returns:
- the boolean
-
isMemberOf
public boolean isMemberOf(GHTeam team)
Returns true if this user belongs to the specified team.- Parameters:
team
- the team- Returns:
- the boolean
-
isPublicMemberOf
public boolean isPublicMemberOf(GHOrganization org)
Returns true if this user belongs to the specified organization as a public member.- Parameters:
org
- the org- Returns:
- the boolean
-
isHireable
public boolean isHireable()
Returns true if this user is marked as hireable, false otherwise- Returns:
- if the user is marked as hireable
-
getBio
public String getBio()
-
getOrganizations
@WithBridgeMethods(java.util.Set.class) public GHPersonSet<GHOrganization> getOrganizations() throws IOException
Gets the organization that this user belongs to publicly.- Returns:
- the organizations
- Throws:
IOException
- the io exception
-
listEvents
public PagedIterable<GHEventInfo> listEvents() throws IOException
Lists events performed by a user (this includes private events if the caller is authenticated.- Specified by:
listEvents
in classGHPerson
- Returns:
- the paged iterable
- Throws:
IOException
- the io exception
-
listGists
public PagedIterable<GHGist> listGists() throws IOException
Lists Gists created by this user.- Returns:
- the paged iterable
- Throws:
IOException
- the io exception
-
-