Interface PlayTime

All Known Implementing Classes:
PlayTimeProvider

public sealed interface PlayTime permits PlayTimeProvider
The PlayTime interface provides methods to manage and manipulate play time for users.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addTime(int userId, PlayTimeType type)
    Adds 1 unit of time to the play time of a user with the given user ID and play time type.
    void
    addTime(int userId, PlayTimeType type, long time)
    Adds the specified amount of time to the play time of a user with the given user ID and play time type.
    void
    createUser(int userId)
    Creates a new user with the given user ID.
    void
    deleteUser(int userId)
    Deletes a user with the given user ID from the database.
    boolean
    existsUser(int userId)
    Checks if a user with the given user ID exists.
    long
    getTime(int userId, PlayTimeType type)
    Obtains the time for the given user ID and play time type.
    void
    removeTime(int userId, PlayTimeType type)
    Removes the play time for a user with the given user ID and play time type.
    void
    removeTime(int userId, PlayTimeType type, long time)
    Removes the specified amount of time from the play time of a user with the given user ID and play time type.
    void
    resetTime(int userId, PlayTimeType type)
    Resets the play time for a user with the given user ID and play time type.
    void
    setTime(int userId, PlayTimeType type, long time)
    Sets the play time for a user with the given user ID and play time type.
    void
    timer(int userId)
    Starts a timer for the specified user.
  • Method Details

    • existsUser

      boolean existsUser(int userId)
      Checks if a user with the given user ID exists.
      Parameters:
      userId - the ID of the user to check
      Returns:
      true if a user with the given ID exists, false otherwise
    • createUser

      void createUser(int userId)
      Creates a new user with the given user ID.
      Parameters:
      userId - the ID of the user to create
    • deleteUser

      void deleteUser(int userId)
      Deletes a user with the given user ID from the database.
      Parameters:
      userId - the ID of the user to delete
    • getTime

      long getTime(int userId, PlayTimeType type)
      Obtains the time for the given user ID and play time type.
      Parameters:
      userId - the ID of the user
      type - the type of play time
      Returns:
      the time for the given user ID and play time type
    • setTime

      void setTime(int userId, PlayTimeType type, long time)
      Sets the play time for a user with the given user ID and play time type.
      Parameters:
      userId - the ID of the user
      type - the type of play time
      time - the play time to set for the user
    • addTime

      void addTime(int userId, PlayTimeType type)
      Adds 1 unit of time to the play time of a user with the given user ID and play time type.
      Parameters:
      userId - the ID of the user
      type - the type of play time
    • addTime

      void addTime(int userId, PlayTimeType type, long time)
      Adds the specified amount of time to the play time of a user with the given user ID and play time type.
      Parameters:
      userId - the ID of the user
      type - the type of play time
      time - the amount of time to add to the user's play time, in milliseconds
    • removeTime

      void removeTime(int userId, PlayTimeType type)
      Removes the play time for a user with the given user ID and play time type.
      Parameters:
      userId - the ID of the user
      type - the type of play time
    • removeTime

      void removeTime(int userId, PlayTimeType type, long time)
      Removes the specified amount of time from the play time of a user with the given user ID and play time type.
      Parameters:
      userId - the ID of the user
      type - the type of play time
      time - the amount of time to remove from the user's play time, in milliseconds
    • resetTime

      void resetTime(int userId, PlayTimeType type)
      Resets the play time for a user with the given user ID and play time type.
      Parameters:
      userId - the ID of the user
      type - the type of play time
    • timer

      void timer(int userId)
      Starts a timer for the specified user.
      Parameters:
      userId - the ID of the user for whom to start the timer