Package dev.plex.cache
Class DataUtils
java.lang.Object
dev.plex.cache.DataUtils
Parent cache class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PlexPlayerstatic PlexPlayerstatic PlexPlayerGets a player from cache or from the databasestatic PlexPlayerstatic PlexPlayergetPlayerByIP(String ip) Gets a player from cache or from the databasestatic booleanhasPlayedBefore(String username) static booleanhasPlayedBefore(UUID uuid) Checks if the player has been on the server beforestatic voidinsert(PlexPlayer plexPlayer) Inserts a player's information in the databasestatic voidupdate(PlexPlayer plexPlayer) Updates a player's information in the database
-
Constructor Details
-
DataUtils
public DataUtils()
-
-
Method Details
-
hasPlayedBefore
Checks if the player has been on the server before- Parameters:
uuid- The unique ID of the player- Returns:
- true if the player is registered in the database
-
hasPlayedBefore
-
getPlayer
Gets a player from cache or from the database- Parameters:
uuid- The unique ID of the player- Returns:
- a PlexPlayer object
- See Also:
-
getPlayer
-
getPlayer
-
getPlayer
-
getPlayerByIP
Gets a player from cache or from the database- Parameters:
ip- The IP address of the player.- Returns:
- a PlexPlayer object
- See Also:
-
update
Updates a player's information in the database- Parameters:
plexPlayer- The PlexPlayer to update- See Also:
-
insert
Inserts a player's information in the database- Parameters:
plexPlayer- The PlexPlayer to insert- See Also:
-