Package ovh.mythmc.social.api.identity
Class AbstractIdentityResolver
java.lang.Object
ovh.mythmc.social.api.identity.AbstractIdentityResolver
- All Implemented Interfaces:
IdentityResolver
- Direct Known Subclasses:
BukkitIdentityResolver
An abstract implementation of
IdentityResolver used by platforms to
provide identities.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidadd(@NotNull Identified identity) fromUsername(@NotNull String username) Attempts to retrieve anIdentifiedinstance from a username.Attempts to retrieve anIdentifiedinstance from a UUID.resolveUsername(@NotNull UUID uuid) Resolves a username from a UUID.resolveUuid(@NotNull String username) Resolves a UUID from a username.protected abstract Iterable<Identified> Gets all identities present in the server.protected voidupdateOrCreate(@NotNull Identified identity)
-
Constructor Details
-
AbstractIdentityResolver
protected AbstractIdentityResolver()
-
-
Method Details
-
serverIdentities
Gets all identities present in the server.- Returns:
- an
Iterablewith everyIdentifiedidentity present in the server
-
fromUsername
Description copied from interface:IdentityResolverAttempts to retrieve anIdentifiedinstance from a username.- Specified by:
fromUsernamein interfaceIdentityResolver- Parameters:
username- the username to resolve- Returns:
- an
Optionalcontaining the resolved identity, or empty if no match is found
-
fromUuid
Description copied from interface:IdentityResolverAttempts to retrieve anIdentifiedinstance from a UUID.- Specified by:
fromUuidin interfaceIdentityResolver- Parameters:
uuid- the UUID to resolve- Returns:
- an
Optionalcontaining the resolved identity, or empty if no match is found
-
resolveUuid
Description copied from interface:IdentityResolverResolves a UUID from a username.- Specified by:
resolveUuidin interfaceIdentityResolver- Parameters:
username- the username to resolve- Returns:
- an
Optionalcontaining the corresponding UUID, or empty if no match is found
-
resolveUsername
Description copied from interface:IdentityResolverResolves a username from a UUID.- Specified by:
resolveUsernamein interfaceIdentityResolver- Parameters:
uuid- the UUID to resolve- Returns:
- an
Optionalcontaining the corresponding username, or empty if no match is found
-
updateOrCreate
-
add
-