Class SQLPlayerRepository

java.lang.Object
com.zetaplugins.essentialz.storage.repositories.Repository
com.zetaplugins.essentialz.storage.repositories.player.SQLPlayerRepository
All Implemented Interfaces:
PlayerRepository

public class SQLPlayerRepository extends Repository implements PlayerRepository
  • Constructor Details

  • Method Details

    • initializeTable

      public void initializeTable()
      Description copied from class: Repository
      Initializes the database table(s) for the repository.
      Specified by:
      initializeTable in class Repository
    • save

      public void save(PlayerData playerData)
      Description copied from interface: PlayerRepository
      Saves the player data to the storage system.
      Specified by:
      save in interface PlayerRepository
      Parameters:
      playerData - The player data to save.
    • load

      @Nullable public @Nullable PlayerData load(UUID uuid)
      Description copied from interface: PlayerRepository
      Loads the player data from the storage system.
      Specified by:
      load in interface PlayerRepository
      Parameters:
      uuid - The UUID of the player to load.
      Returns:
      The player data of the player.
    • load

      @Nullable public @Nullable PlayerData load(String uuid)
      Description copied from interface: PlayerRepository
      Loads the player data from the storage system.
      Specified by:
      load in interface PlayerRepository
      Parameters:
      uuid - The UUID of the player to load.
      Returns:
      The player data of the player.
    • getTopBalances

      public Map<UUID,Double> getTopBalances(int topN)
      Description copied from interface: PlayerRepository
      Gets the top N players with the highest balances.
      Specified by:
      getTopBalances in interface PlayerRepository
      Parameters:
      topN - The number of top players to retrieve.
      Returns:
      A map of player UUIDs and their balances, sorted by balance in descending order.