Class UUIDUtility
- java.lang.Object
-
- com.djrapitops.plan.identification.UUIDUtility
-
@Singleton public class UUIDUtility extends java.lang.Object
Utility for fetching a user's UUID.Attempts are made in order: - Parse UUID out of the given String - Find an UUID from the database matching the player name - Find an UUID from Mojang API that matches the player name
-
-
Constructor Summary
Constructors Constructor Description UUIDUtility(DBSystem dbSystem, ErrorLogger errorLogger)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<java.lang.String>
getNameOf(java.lang.String possiblePlayerUUID)
java.util.Optional<java.lang.String>
getNameOf(java.util.UUID playerUUID)
java.util.UUID
getUUIDOf(java.lang.String playerName)
Get UUID of a player.static java.util.Optional<java.util.UUID>
parseFromString(java.lang.String uuidString)
-
-
-
Constructor Detail
-
UUIDUtility
@Inject public UUIDUtility(DBSystem dbSystem, ErrorLogger errorLogger)
-
-
Method Detail
-
parseFromString
public static java.util.Optional<java.util.UUID> parseFromString(java.lang.String uuidString)
-
getNameOf
public java.util.Optional<java.lang.String> getNameOf(java.lang.String possiblePlayerUUID)
-
getNameOf
public java.util.Optional<java.lang.String> getNameOf(java.util.UUID playerUUID)
-
getUUIDOf
public java.util.UUID getUUIDOf(java.lang.String playerName)
Get UUID of a player.- Parameters:
playerName
- Player's name- Returns:
- UUID of the player
-
-