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 of GHUser and GHOrganization.
Author:
Kohsuke Kawaguchi
  • Field Details

    • login

      protected String login
      The avatar url.
    • avatar_url

      protected String avatar_url
      The avatar url.
    • location

      protected String location
      The twitter username.
    • blog

      protected String blog
      The twitter username.
    • email

      protected String email
      The twitter username.
    • bio

      protected String bio
      The twitter username.
    • name

      protected String name
      The twitter username.
    • company

      protected String company
      The twitter username.
    • type

      protected String type
      The twitter username.
    • twitter_username

      protected String twitter_username
      The twitter username.
    • html_url

      protected String html_url
      The html url.
    • followers

      protected int followers
      The public gists.
    • following

      protected int following
      The public gists.
    • public_repos

      protected int public_repos
      The public gists.
    • public_gists

      protected int public_gists
      The public gists.
    • site_admin

      protected boolean site_admin
      The hireable.
    • hireable

      protected boolean hireable
      The hireable.
    • total_private_repos

      protected Integer total_private_repos
      The total private repos.
  • Constructor Details

    • GHPerson

      public GHPerson()
      Create default GHPerson instance
  • Method Details

    • populate

      protected void populate() throws IOException
      Fully 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()
      List all the repositories using a default of 30 items page size.

      Unlike getRepositories(), this does not wait until all the repositories are returned.

      Returns:
      the paged iterable
    • listRepositories

      @Deprecated public PagedIterable<GHRepository> listRepositories(int pageSize)
      Deprecated.
      Use #listRepositories().withPageSize() instead.
      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. Unlike getRepositories(), this does not wait until all the repositories are returned.
      Returns:
      the paged 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
    • 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
      Gets the created at.
      Overrides:
      getCreatedAt in class GHObject
      Returns:
      the created at
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getUpdatedAt

      public Date getUpdatedAt() throws IOException
      Gets the updated at.
      Overrides:
      getUpdatedAt in class GHObject
      Returns:
      the updated at
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • 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()
      Gets the html url.
      Returns:
      the html url
    • 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 IOException
      Gets public gist count.
      Returns:
      the public gist count
      Throws:
      IOException - the io exception
    • getPublicRepoCount

      public int getPublicRepoCount() throws IOException
      Gets public repo count.
      Returns:
      the public repo count
      Throws:
      IOException - the io exception
    • getFollowingCount

      public int getFollowingCount() throws IOException
      Gets following count.
      Returns:
      the following count
      Throws:
      IOException - the io exception
    • getFollowersCount

      public int getFollowersCount() throws IOException
      Gets 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 IOException
      Gets 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