Class MuteProvider

java.lang.Object
de.murmelmeister.murmelapi.bansystem.mute.MuteProvider
All Implemented Interfaces:
Mute

public final class MuteProvider extends Object implements Mute
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    private static enum 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Log
     
    private final Reason
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private void
    createTable(String tableName)
     
    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.

    Methods inherited from class java.lang.Object

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

    • reason

      private final Reason reason
    • log

      private final Log log
  • Constructor Details

    • MuteProvider

      public MuteProvider()
  • Method Details

    • createTable

      private void createTable(String tableName)
    • mute

      public void mute(int userId, int creatorId, int reasonId, long time)
      Description copied from interface: Mute
      Mutes a user for a specified period of time.
      Specified by:
      mute in interface Mute
      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

      public void unmute(int userId)
      Description copied from interface: Mute
      Unmutes a user, removing any mute restrictions previously placed on them.
      Specified by:
      unmute in interface Mute
      Parameters:
      userId - The ID of the user to be unmuted.
    • getExpiredTime

      public long getExpiredTime(int userId)
      Description copied from interface: Mute
      Retrieves the expiration time of the mute for the specified user.
      Specified by:
      getExpiredTime in interface Mute
      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

      public String getExpiredDate(int userId)
      Description copied from interface: Mute
      Retrieves the expiration date of the mute for the specified user.
      Specified by:
      getExpiredDate in interface Mute
      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

      public boolean isMuted(int userId)
      Description copied from interface: Mute
      Checks if a user is currently muted.
      Specified by:
      isMuted in interface Mute
      Parameters:
      userId - The ID of the user to be checked.
      Returns:
      True if the user is muted, false otherwise.
    • getReason

      public Reason getReason()
      Description copied from interface: Mute
      Provides the reason associated with the mute action.
      Specified by:
      getReason in interface Mute
      Returns:
      The reason for the mute, represented as a Reason object.
    • getLog

      public Log getLog()
      Description copied from interface: Mute
      Retrieves the log associated with the mute actions.
      Specified by:
      getLog in interface Mute
      Returns:
      The log object that stores and retrieves entries related to mute actions.