Record Class PunishmentLog

java.lang.Object
java.lang.Record
de.murmelmeister.murmelapi.punishment.audit.PunishmentLog
Record Components:
reasonId - ID of the reason, null if reason id deleted
reasonDuration - Duration in seconds, null for permanent punishments

public record PunishmentLog(UUID id, PunishmentLog.Action action, Integer userId, String ipAddress, Integer reasonId, int reasonTypeId, String reasonText, Long reasonDuration, boolean reasonAutoFlagIp, boolean reasonAutoPunish, int createdBy, LocalDateTime createdAt) extends Record
Represents a log entry for a punishment action. This class is used to track the history of punishments applied to users.
  • Field Details

    • id

      private final UUID id
      The field for the id record component.
    • action

      private final PunishmentLog.Action action
      The field for the action record component.
    • userId

      private final Integer userId
      The field for the userId record component.
    • ipAddress

      private final String ipAddress
      The field for the ipAddress record component.
    • reasonId

      private final Integer reasonId
      The field for the reasonId record component.
    • reasonTypeId

      private final int reasonTypeId
      The field for the reasonTypeId record component.
    • reasonText

      private final String reasonText
      The field for the reasonText record component.
    • reasonDuration

      private final Long reasonDuration
      The field for the reasonDuration record component.
    • reasonAutoFlagIp

      private final boolean reasonAutoFlagIp
      The field for the reasonAutoFlagIp record component.
    • reasonAutoPunish

      private final boolean reasonAutoPunish
      The field for the reasonAutoPunish record component.
    • createdBy

      private final int createdBy
      The field for the createdBy record component.
    • createdAt

      private final LocalDateTime createdAt
      The field for the createdAt record component.
  • Constructor Details

    • PunishmentLog

      public PunishmentLog(UUID id, PunishmentLog.Action action, Integer userId, String ipAddress, Integer reasonId, int reasonTypeId, String reasonText, Long reasonDuration, boolean reasonAutoFlagIp, boolean reasonAutoPunish, int createdBy, LocalDateTime createdAt)
      Creates an instance of a PunishmentLog record class.
      Parameters:
      id - the value for the id record component
      action - the value for the action record component
      userId - the value for the userId record component
      ipAddress - the value for the ipAddress record component
      reasonId - the value for the reasonId record component
      reasonTypeId - the value for the reasonTypeId record component
      reasonText - the value for the reasonText record component
      reasonDuration - the value for the reasonDuration record component
      reasonAutoFlagIp - the value for the reasonAutoFlagIp record component
      reasonAutoPunish - the value for the reasonAutoPunish record component
      createdBy - the value for the createdBy record component
      createdAt - the value for the createdAt record component
  • Method Details

    • expiresAt

      public LocalDateTime expiresAt()
    • isExpired

      public boolean isExpired()
    • isPermanent

      public boolean isPermanent()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      public UUID id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • action

      public PunishmentLog.Action action()
      Returns the value of the action record component.
      Returns:
      the value of the action record component
    • userId

      public Integer userId()
      Returns the value of the userId record component.
      Returns:
      the value of the userId record component
    • ipAddress

      public String ipAddress()
      Returns the value of the ipAddress record component.
      Returns:
      the value of the ipAddress record component
    • reasonId

      public Integer reasonId()
      Returns the value of the reasonId record component.
      Returns:
      the value of the reasonId record component
    • reasonTypeId

      public int reasonTypeId()
      Returns the value of the reasonTypeId record component.
      Returns:
      the value of the reasonTypeId record component
    • reasonText

      public String reasonText()
      Returns the value of the reasonText record component.
      Returns:
      the value of the reasonText record component
    • reasonDuration

      public Long reasonDuration()
      Returns the value of the reasonDuration record component.
      Returns:
      the value of the reasonDuration record component
    • reasonAutoFlagIp

      public boolean reasonAutoFlagIp()
      Returns the value of the reasonAutoFlagIp record component.
      Returns:
      the value of the reasonAutoFlagIp record component
    • reasonAutoPunish

      public boolean reasonAutoPunish()
      Returns the value of the reasonAutoPunish record component.
      Returns:
      the value of the reasonAutoPunish record component
    • createdBy

      public int createdBy()
      Returns the value of the createdBy record component.
      Returns:
      the value of the createdBy record component
    • createdAt

      public LocalDateTime createdAt()
      Returns the value of the createdAt record component.
      Returns:
      the value of the createdAt record component