Interface SocialRepository


public interface SocialRepository
Repository for managing social interactions and player data in FlectonePulse. Handles ignore relationships, mail messages, color settings, and player preferences with caching support.
Since:
0.8.1
  • Method Details

    • invalidate

      void invalidate()
      Invalidates all cached data in the social repository. Clears player color cache, settings cache, and ignore cache
    • loadIgnores

      List<Ignore> loadIgnores(FPlayer fPlayer)
      Loads ignore relationships for a player with cache support. Returns cached ignores if available, otherwise loads from database and caches the result.
      Parameters:
      fPlayer - the player to load ignores for
      Returns:
      list of ignore relationships for the player
    • invalidateIgnores

      void invalidateIgnores(UUID uuid)
      Invalidates cached ignore relationships for a player.
      Parameters:
      uuid - the UUID of the player whose ignore cache should be cleared
    • saveIgnore

      Optional<Ignore> saveIgnore(FPlayer fPlayer, FPlayer fTarget)
      Saves an ignore relationship between two players and updates the cache.
      Parameters:
      fPlayer - the player who is ignoring
      fTarget - the player being ignored
      Returns:
      Optional containing the created ignore record, or empty if creation failed
    • deleteIgnore

      void deleteIgnore(FPlayer fPlayer, Ignore ignore)
      Deletes an ignore relationship and updates the cache.
      Parameters:
      fPlayer - the player who was ignoring
      ignore - the ignore record to delete
    • getReceiverMails

      List<Mail> getReceiverMails(FPlayer fPlayer)
      Gets all mail messages received by a player.
      Parameters:
      fPlayer - the player who received the mail messages
      Returns:
      list of received mail messages
    • getSenderMails

      List<Mail> getSenderMails(FPlayer fPlayer)
      Gets all mail messages sent by a player.
      Parameters:
      fPlayer - the player who sent the mail messages
      Returns:
      list of sent mail messages
    • saveMail

      Optional<Mail> saveMail(FPlayer fPlayer, FPlayer fTarget, String message)
      Saves a mail message from one player to another.
      Parameters:
      fPlayer - the sender of the mail message
      fTarget - the recipient of the mail message
      message - the content of the mail message
      Returns:
      Optional containing the created mail record, or empty if creation failed
    • deleteMail

      void deleteMail(Mail mail)
      Deletes a mail message from the database.
      Parameters:
      mail - the mail record to delete
    • loadColors

      Map<FColor.Type, Set<FColor>> loadColors(@NonNull FPlayer fPlayer)
      Loads color settings for a player with cache support. Returns cached colors if available, otherwise loads from database and caches the result.
      Parameters:
      fPlayer - the player to load colors for
      Returns:
      map of color types to sets of FColor objects
    • invalidateColors

      void invalidateColors(UUID uuid)
      Invalidates cached color settings for a player.
      Parameters:
      uuid - the UUID of the player whose color cache should be cleared
    • saveColors

      void saveColors(@NonNull FPlayer fPlayer, @NonNull Map<FColor.Type, Set<FColor>> colors)
      Saves color settings for a player to the database and updates the cache.
      Parameters:
      fPlayer - the player whose colors are being saved
      colors - map of color types to sets of FColor objects to save
    • loadSettings

      SocialRepository.Settings loadSettings(@NonNull FPlayer fPlayer)
      Loads all settings for a player with cache support. Returns cached settings if available, otherwise loads from database and caches the result.
      Parameters:
      fPlayer - the player to load settings for
      Returns:
      Settings object containing boolean and text settings
    • invalidateSettings

      void invalidateSettings(UUID uuid)
      Invalidates cached settings for a player.
      Parameters:
      uuid - the UUID of the player whose settings cache should be cleared
    • saveOrUpdateSetting

      void saveOrUpdateSetting(@NonNull FPlayer fPlayer, @NonNull String setting, boolean value)
      Saves or updates a specific boolean setting for a player and updates the cache.
      Parameters:
      fPlayer - the player whose setting is being saved
      setting - the name of the boolean setting
      value - the boolean value to set
    • saveOrUpdateSetting

      void saveOrUpdateSetting(@NonNull FPlayer fPlayer, @NonNull String setting, @Nullable String value)
      Saves or updates a specific text setting for a player and updates the cache.
      Parameters:
      fPlayer - the player whose setting is being saved
      setting - the SettingText enum representing the text setting type
      value - the text value to set, can be null to remove the setting