Class RepositoryUserInfo

java.lang.Object
io.github.thecsdev.tcdcommons.api.util.io.repo.RepositoryUserInfo
Direct Known Subclasses:
GitHubUserInfo

public abstract class RepositoryUserInfo extends Object
Provides information about a given user whose account is registered on a repository hosting platform.
See Also:
  • Constructor Details

    • RepositoryUserInfo

      public RepositoryUserInfo()
  • Method Details

    • getHost

      public abstract RepositoryHostInfo getHost()
      Returns the RepositoryHostInfo about the host that hosts this user's account.
    • getID

      public abstract String getID()
      Returns a String representation of the user's unique account identifier.
    • getAccountName

      public abstract String getAccountName()
      Returns the unique username of the account. This username has to be unique to this account on the entire repository platform.
    • getDisplayName

      public abstract String getDisplayName()
      Returns the "display name" for this account. Does not have to be "unique".
    • getBiography

      @Nullable public abstract @Nullable String getBiography()
      Returns the user's "biography"/"about me" text, if there is one. May return null if the user doesn't have one.
    • getAvatarImageURI

      @Nullable public @Nullable URI getAvatarImageURI()
      Returns the URI that points to the resource that holds the user's avatar image. Could be a WWW URL or a file. May also be null if the user does not have an avatar image.
    • getFollowerCount

      @Nullable public @Nullable BigInteger getFollowerCount()
      Returns the number of "followers" this user has, or null if unsupported.
    • getFollowingCount

      @Nullable public @Nullable BigInteger getFollowingCount()
      Returns the number of users this user "follows", or null if unsupported.
    • getRepositoryCount

      @Nullable public @Nullable BigInteger getRepositoryCount()
      Returns the number of public repositories this user has, or null if unsupported.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getAvatarImageAsync

      public final void getAvatarImageAsync(net.minecraft.util.thread.ThreadExecutor<?> minecraftClientOrServer, Consumer<byte[]> onReady, Consumer<Exception> onError) throws NullPointerException
      Asynchronously fetches the "png" image bytes of the user's avatar image.
      Throws:
      NullPointerException - If an argument is null.
      See Also:
    • fetchAvatarImageSync

      public byte[] fetchAvatarImageSync() throws NullPointerException, net.minecraft.util.InvalidIdentifierException, IOException
      Synchronously fetches the "png" image bytes of the user's avatar image.
      Throws:
      NullPointerException - If a non-Nullable method in this Object returns null.
      net.minecraft.util.InvalidIdentifierException - If RepositoryHostInfo.getID() returns a String that is incompatible with Identifier namespaces.
      IOException - If an IOException is raised while fetching.
      See Also: