All Known Implementing Classes:
MuteProvider

public sealed interface Mute permits MuteProvider
The Mute interface represents operations related to muting and unmuting users in a system, including actions that define the duration and reason for the mute.
  • Method Summary

    Modifier and Type
    Method
    Description
    getExpiredDate(int userId)
    Retrieves the expiration date of the mute for the specified user.
    long
    getExpiredTime(int userId)
    Retrieves the expiration time of the mute for the specified user.
    Retrieves the log associated with the mute actions.
    Provides the reason associated with the mute action.
    boolean
    isMuted(int userId)
    Checks if a user is currently muted.
    void
    mute(int userId, int creatorId, int reasonId, long time)
    Mutes a user for a specified period of time.
    void
    unmute(int userId)
    Unmutes a user, removing any mute restrictions previously placed on them.
  • Method Details

    • mute

      void mute(int userId, int creatorId, int reasonId, long time)
      Mutes a user for a specified period of time.
      Parameters:
      userId - The ID of the user to be muted.
      creatorId - The ID of the user who initiates the mute action.
      reasonId - The ID of the reason for the mute.
      time - The duration of the mute in milliseconds from the current time.
    • unmute

      void unmute(int userId)
      Unmutes a user, removing any mute restrictions previously placed on them.
      Parameters:
      userId - The ID of the user to be unmuted.
    • getExpiredTime

      long getExpiredTime(int userId)
      Retrieves the expiration time of the mute for the specified user.
      Parameters:
      userId - The ID of the user whose mute expiration time is to be retrieved.
      Returns:
      The expiration time of the mute in milliseconds since epoch, or -1 if the user is not muted.
    • getExpiredDate

      String getExpiredDate(int userId)
      Retrieves the expiration date of the mute for the specified user.
      Parameters:
      userId - The ID of the user whose mute expiration date is to be retrieved.
      Returns:
      The expiration date of the mute as a string.
    • isMuted

      boolean isMuted(int userId)
      Checks if a user is currently muted.
      Parameters:
      userId - The ID of the user to be checked.
      Returns:
      True if the user is muted, false otherwise.
    • getReason

      Reason getReason()
      Provides the reason associated with the mute action.
      Returns:
      The reason for the mute, represented as a Reason object.
    • getLog

      Log getLog()
      Retrieves the log associated with the mute actions.
      Returns:
      The log object that stores and retrieves entries related to mute actions.