Package org.kohsuke.github
Class GHPerson
- java.lang.Object
-
- org.kohsuke.github.GHObject
-
- org.kohsuke.github.GHPerson
-
- Direct Known Subclasses:
GHOrganization,GHUser
public abstract class GHPerson extends GHObject
Common part ofGHUserandGHOrganization.- Author:
- Kohsuke Kawaguchi
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringavatar_urlprotected Stringbioprotected Stringblogprotected Stringcompanyprotected Stringemailprotected intfollowersprotected intfollowingprotected booleanhireableprotected Stringhtml_urlprotected Stringlocationprotected Stringloginprotected Stringnameprotected intpublic_gistsprotected intpublic_reposprotected booleansite_adminprotected Integertotal_private_reposprotected Stringtwitter_usernameprotected Stringtype-
Fields inherited from class org.kohsuke.github.GHObject
responseHeaderFields
-
-
Constructor Summary
Constructors Constructor Description GHPerson()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description StringgetAvatarUrl()Returns a string of the avatar image URL.StringgetBlog()Gets the blog URL of this user.StringgetCompany()Gets the company name of this user, like "Sun Microsystems, Inc."DategetCreatedAt()When was this resource created?StringgetEmail()Gets the e-mail address of the user.intgetFollowersCount()Gets followers count.intgetFollowingCount()Gets following count.StringgetGravatarId()Deprecated.No longer available in the v3 API.URLgetHtmlUrl()Gets html url.StringgetLocation()Gets the location of this user, like "Santa Clara, California"StringgetLogin()Gets the login ID of this user, like 'kohsuke'StringgetName()Gets the human-readable name of the user, like "Kohsuke Kawaguchi"intgetPublicGistCount()Gets public gist count.intgetPublicRepoCount()Gets public repo count.Map<String,GHRepository>getRepositories()Gets the public repositories this user owns.GHRepositorygetRepository(String name)Gets repository.Optional<Integer>getTotalPrivateRepoCount()Gets total private repo count.StringgetTwitterUsername()Gets the Twitter Username of this user, like "GitHub"StringgetType()Gets the type.DategetUpdatedAt()When was this resource last updated?booleanisSiteAdmin()Gets the site_admin fieldIterable<List<GHRepository>>iterateRepositories(int pageSize)Deprecated.abstract PagedIterable<GHEventInfo>listEvents()Lists events for an organization or an user.PagedIterable<GHRepository>listRepositories()Lists up all the repositories using a 30 items page size.PagedIterable<GHRepository>listRepositories(int pageSize)Lists up all the repositories using the specified page size.protected voidpopulate()Fully populate the data by retrieving missing data.-
Methods inherited from class org.kohsuke.github.GHObject
getId, getNodeId, getResponseHeaderFields, getUrl, setResponseHeaderFields, toString
-
-
-
-
Field Detail
-
login
protected String login
-
avatar_url
protected String avatar_url
-
location
protected String location
-
blog
protected String blog
-
email
protected String email
-
bio
protected String bio
-
name
protected String name
-
company
protected String company
-
type
protected String type
-
twitter_username
protected String twitter_username
-
html_url
protected String html_url
-
followers
protected int followers
-
following
protected int following
-
public_repos
protected int public_repos
-
public_gists
protected int public_gists
-
site_admin
protected boolean site_admin
-
hireable
protected boolean hireable
-
total_private_repos
protected Integer total_private_repos
-
-
Method Detail
-
populate
protected void populate() throws IOExceptionFully populate the data by retrieving missing data.Depending on the original API call where this object is created, it may not contain everything.
- Throws:
IOException- the io exception
-
getRepositories
public Map<String,GHRepository> getRepositories() throws IOException
Gets the public repositories this user owns.To list your own repositories, including private repositories, use
GHMyself.listRepositories()- Returns:
- the repositories
- Throws:
IOException- the io exception
-
listRepositories
public PagedIterable<GHRepository> listRepositories()
Lists up all the repositories using a 30 items page size.Unlike
getRepositories(), this does not wait until all the repositories are returned.- Returns:
- the paged iterable
-
listRepositories
public PagedIterable<GHRepository> listRepositories(int pageSize)
Lists up all the repositories using the specified page size.- Parameters:
pageSize- size for each page of items returned by GitHub. Maximum page size is 100. UnlikegetRepositories(), this does not wait until all the repositories are returned.- Returns:
- the paged iterable
-
iterateRepositories
@Deprecated public Iterable<List<GHRepository>> iterateRepositories(int pageSize)
Deprecated.Loads repository list in a paginated fashion.For a person with a lot of repositories, GitHub returns the list of repositories in a paginated fashion. Unlike
getRepositories(), this method allows the caller to start processing data as it arrives.Every
Iterator.next()call results in I/O. Exceptions that occur during the processing is wrapped intoError.- Parameters:
pageSize- the page size- Returns:
- the iterable
-
getRepository
public GHRepository getRepository(String name) throws IOException
Gets repository.- Parameters:
name- the name- Returns:
- null if the repository was not found
- Throws:
IOException- the io exception
-
listEvents
public abstract PagedIterable<GHEventInfo> listEvents() throws IOException
Lists events for an organization or an user.- Returns:
- the paged iterable
- Throws:
IOException- the io exception
-
getGravatarId
@Deprecated public String getGravatarId()
Deprecated.No longer available in the v3 API.Gravatar ID of this user, like 0cb9832a01c22c083390f3c5dcb64105- Returns:
- the gravatar id
-
getAvatarUrl
public String getAvatarUrl()
Returns a string of the avatar image URL.- Returns:
- the avatar url
-
getLogin
public String getLogin()
Gets the login ID of this user, like 'kohsuke'- Returns:
- the login
-
getName
public String getName() throws IOException
Gets the human-readable name of the user, like "Kohsuke Kawaguchi"- Returns:
- the name
- Throws:
IOException- the io exception
-
getCompany
public String getCompany() throws IOException
Gets the company name of this user, like "Sun Microsystems, Inc."- Returns:
- the company
- Throws:
IOException- the io exception
-
getLocation
public String getLocation() throws IOException
Gets the location of this user, like "Santa Clara, California"- Returns:
- the location
- Throws:
IOException- the io exception
-
getTwitterUsername
public String getTwitterUsername() throws IOException
Gets the Twitter Username of this user, like "GitHub"- Returns:
- the Twitter username
- Throws:
IOException- the io exception
-
getCreatedAt
public Date getCreatedAt() throws IOException
Description copied from class:GHObjectWhen was this resource created?- Overrides:
getCreatedAtin classGHObject- Returns:
- date created
- Throws:
IOException- on error
-
getUpdatedAt
public Date getUpdatedAt() throws IOException
Description copied from class:GHObjectWhen was this resource last updated?- Overrides:
getUpdatedAtin classGHObject- Returns:
- updated date
- Throws:
IOException- on error
-
getBlog
public String getBlog() throws IOException
Gets the blog URL of this user.- Returns:
- the blog
- Throws:
IOException- the io exception
-
getHtmlUrl
public URL getHtmlUrl()
Description copied from class:GHObjectGets html url.- Specified by:
getHtmlUrlin classGHObject- Returns:
- URL of this object for humans, which renders some HTML.
-
getEmail
public String getEmail() throws IOException
Gets the e-mail address of the user.- Returns:
- the email
- Throws:
IOException- the io exception
-
getPublicGistCount
public int getPublicGistCount() throws IOExceptionGets public gist count.- Returns:
- the public gist count
- Throws:
IOException- the io exception
-
getPublicRepoCount
public int getPublicRepoCount() throws IOExceptionGets public repo count.- Returns:
- the public repo count
- Throws:
IOException- the io exception
-
getFollowingCount
public int getFollowingCount() throws IOExceptionGets following count.- Returns:
- the following count
- Throws:
IOException- the io exception
-
getFollowersCount
public int getFollowersCount() throws IOExceptionGets followers count.- Returns:
- the followers count
- Throws:
IOException- the io exception
-
getType
public String getType() throws IOException
Gets the type. This is either "User" or "Organization".- Returns:
- the type
- Throws:
IOException- the io exception
-
isSiteAdmin
public boolean isSiteAdmin() throws IOExceptionGets the site_admin field- Returns:
- the site_admin field
- Throws:
IOException- the io exception
-
getTotalPrivateRepoCount
public Optional<Integer> getTotalPrivateRepoCount() throws IOException
Gets total private repo count.- Returns:
- the total private repo count
- Throws:
IOException- the io exception
-
-