Class SQLPlayerRepository
java.lang.Object
com.zetaplugins.essentialz.storage.repositories.Repository
com.zetaplugins.essentialz.storage.repositories.player.SQLPlayerRepository
- All Implemented Interfaces:
PlayerRepository
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetTopBalances(int topN) Gets the top N players with the highest balances.voidInitializes the database table(s) for the repository.@Nullable PlayerDataLoads the player data from the storage system.@Nullable PlayerDataLoads the player data from the storage system.voidsave(PlayerData playerData) Saves the player data to the storage system.Methods inherited from class com.zetaplugins.essentialz.storage.repositories.Repository
getConnection, getPlugin
-
Constructor Details
-
SQLPlayerRepository
-
-
Method Details
-
initializeTable
public void initializeTable()Description copied from class:RepositoryInitializes the database table(s) for the repository.- Specified by:
initializeTablein classRepository
-
save
Description copied from interface:PlayerRepositorySaves the player data to the storage system.- Specified by:
savein interfacePlayerRepository- Parameters:
playerData- The player data to save.
-
load
Description copied from interface:PlayerRepositoryLoads the player data from the storage system.- Specified by:
loadin interfacePlayerRepository- Parameters:
uuid- The UUID of the player to load.- Returns:
- The player data of the player.
-
load
Description copied from interface:PlayerRepositoryLoads the player data from the storage system.- Specified by:
loadin interfacePlayerRepository- Parameters:
uuid- The UUID of the player to load.- Returns:
- The player data of the player.
-
getTopBalances
Description copied from interface:PlayerRepositoryGets the top N players with the highest balances.- Specified by:
getTopBalancesin interfacePlayerRepository- Parameters:
topN- The number of top players to retrieve.- Returns:
- A map of player UUIDs and their balances, sorted by balance in descending order.
-