Package cn.lunadeer.dominion.api.dtos
Interface PlayerDTO
public interface PlayerDTO
Public view of a player record stored by Dominion.
Player records contain the last known profile information used by the API; they do not require the player to be online.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongetId()Gets the ID of the player.Gets the last known name of the player.@NotNull URLGets the URL of the player's skin.Gets the ID of the group title the player is using.getUuid()Gets the UUID of the player.updateLastKnownName(@NotNull String name, @Nullable URL skinUrl) Updates the last known name and skin URL of the player.
-
Field Details
-
UNKNOWN
Placeholder record used when a player cannot be resolved from the cache. Its numeric identifiers are-1, its UUID is the all-zero UUID, and its name is"Unknown".
-
-
Method Details
-
getId
Integer getId()Gets the ID of the player.- Returns:
- the ID of the player
-
getUuid
UUID getUuid()Gets the UUID of the player.- Returns:
- the UUID of the player
-
getLastKnownName
String getLastKnownName()Gets the last known name of the player.- Returns:
- the last known name of the player
-
updateLastKnownName
PlayerDTO updateLastKnownName(@NotNull @NotNull String name, @Nullable @Nullable URL skinUrl) throws SQLException, MalformedURLException Updates the last known name and skin URL of the player.- Parameters:
name- the new last known name of the playerskinUrl- the new skin URL, ornullto use the default skin- Returns:
- this player record after the profile has been updated
- Throws:
SQLException- if the profile cannot be persistedMalformedURLException- if the supplied or default skin URL is invalid
-
getUsingGroupTitleID
Integer getUsingGroupTitleID()Gets the ID of the group title the player is using.- Returns:
- the ID of the group title the player is using
-
getSkinUrl
Gets the URL of the player's skin.Implementations may return a default skin URL when no custom skin is stored.
- Returns:
- the URL of the player's skin
- Throws:
MalformedURLException- if the stored skin URL is malformed
-