Class RepositoryUserInfo
java.lang.Object
io.github.thecsdev.tcdcommons.api.util.io.repo.RepositoryUserInfo
- Direct Known Subclasses:
GitHubUserInfo
Provides information about a given user whose account is registered on a repository hosting platform.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
byte[]
Synchronously fetches the "png" image bytes of the user's avatar image.abstract String
Returns the unique username of the account.final void
getAvatarImageAsync
(net.minecraft.util.thread.ThreadExecutor<?> minecraftClientOrServer, Consumer<byte[]> onReady, Consumer<Exception> onError) Asynchronously fetches the "png" image bytes of the user's avatar image.@Nullable URI
Returns theURI
that points to the resource that holds the user's avatar image.abstract @Nullable String
Returns the user's "biography"/"about me" text, if there is one.abstract String
Returns the "display name" for this account.@Nullable BigInteger
Returns the number of "followers" this user has, ornull
if unsupported.@Nullable BigInteger
Returns the number of users this user "follows", ornull
if unsupported.abstract RepositoryHostInfo
getHost()
Returns theRepositoryHostInfo
about the host that hosts this user's account.abstract String
getID()
Returns aString
representation of the user's unique account identifier.@Nullable BigInteger
Returns the number of public repositories this user has, ornull
if unsupported.int
hashCode()
-
Constructor Details
-
RepositoryUserInfo
public RepositoryUserInfo()
-
-
Method Details
-
getHost
Returns theRepositoryHostInfo
about the host that hosts this user's account. -
getID
Returns aString
representation of the user's unique account identifier. -
getAccountName
Returns the unique username of the account. This username has to be unique to this account on the entire repository platform. -
getDisplayName
Returns the "display name" for this account. Does not have to be "unique". -
getBiography
Returns the user's "biography"/"about me" text, if there is one. May returnnull
if the user doesn't have one. -
getAvatarImageURI
Returns theURI
that points to the resource that holds the user's avatar image. Could be a WWW URL or a file. May also benull
if the user does not have an avatar image. -
getFollowerCount
Returns the number of "followers" this user has, ornull
if unsupported. -
getFollowingCount
Returns the number of users this user "follows", ornull
if unsupported. -
getRepositoryCount
Returns the number of public repositories this user has, ornull
if unsupported. -
hashCode
public int hashCode() -
equals
-
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 isnull
.- See Also:
-
fetchAvatarImageSync
public byte[] fetchAvatarImageSync() throws NullPointerException, net.minecraft.util.InvalidIdentifierException, IOExceptionSynchronously fetches the "png" image bytes of the user's avatar image.- Throws:
NullPointerException
- If a non-Nullable
method in thisObject
returnsnull
.net.minecraft.util.InvalidIdentifierException
- IfRepositoryHostInfo.getID()
returns aString
that is incompatible withIdentifier
namespaces.IOException
- If anIOException
is raised while fetching.- See Also:
-