Class MongoPlayerData

java.lang.Object
dev.plex.cache.MongoPlayerData

public class MongoPlayerData extends Object
Mongo fetching utilities for players
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final dev.morphia.Datastore
    The datastore object / database
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of the player data
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    exists(UUID uuid)
    Checks whether the player exists in mongo's database
    Gets the player from cache or from mongo's database
    void
    save(PlexPlayer plexPlayer)
    Saves the player's information in the database
    void
    Updates a player's information in the mongo database

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • datastore

      private final dev.morphia.Datastore datastore
      The datastore object / database
  • Constructor Details

    • MongoPlayerData

      public MongoPlayerData()
      Creates an instance of the player data
  • Method Details

    • exists

      public boolean exists(UUID uuid)
      Checks whether the player exists in mongo's database
      Parameters:
      uuid - The unique ID of the player
      Returns:
      true if the player was found
    • getByUUID

      public PlexPlayer getByUUID(UUID uuid)
      Gets the player from cache or from mongo's database
      Parameters:
      uuid - The unique ID of the player
      Returns:
      a PlexPlayer object
      See Also:
    • update

      public void update(PlexPlayer player)
      Updates a player's information in the mongo database
      Parameters:
      player - The PlexPlayer object
      See Also:
    • save

      public void save(PlexPlayer plexPlayer)
      Saves the player's information in the database
      Parameters:
      plexPlayer - The PlexPlayer object
      See Also: