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 deletedreasonDuration- 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.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final PunishmentLog.ActionThe field for theactionrecord component.private final LocalDateTimeThe field for thecreatedAtrecord component.private final intThe field for thecreatedByrecord component.private final UUIDThe field for theidrecord component.private final StringThe field for theipAddressrecord component.private final booleanThe field for thereasonAutoFlagIprecord component.private final booleanThe field for thereasonAutoPunishrecord component.private final LongThe field for thereasonDurationrecord component.private final IntegerThe field for thereasonIdrecord component.private final StringThe field for thereasonTextrecord component.private final intThe field for thereasonTypeIdrecord component.private final IntegerThe field for theuserIdrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionPunishmentLog(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 aPunishmentLogrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaction()Returns the value of theactionrecord component.Returns the value of thecreatedAtrecord component.intReturns the value of thecreatedByrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.Returns the value of theipAddressrecord component.booleanbooleanbooleanReturns the value of thereasonAutoFlagIprecord component.booleanReturns the value of thereasonAutoPunishrecord component.Returns the value of thereasonDurationrecord component.reasonId()Returns the value of thereasonIdrecord component.Returns the value of thereasonTextrecord component.intReturns the value of thereasonTypeIdrecord component.final StringtoString()Returns a string representation of this record class.userId()Returns the value of theuserIdrecord component.
-
Field Details
-
id
The field for theidrecord component. -
action
The field for theactionrecord component. -
userId
The field for theuserIdrecord component. -
ipAddress
The field for theipAddressrecord component. -
reasonId
The field for thereasonIdrecord component. -
reasonTypeId
private final int reasonTypeIdThe field for thereasonTypeIdrecord component. -
reasonText
The field for thereasonTextrecord component. -
reasonDuration
The field for thereasonDurationrecord component. -
reasonAutoFlagIp
private final boolean reasonAutoFlagIpThe field for thereasonAutoFlagIprecord component. -
reasonAutoPunish
private final boolean reasonAutoPunishThe field for thereasonAutoPunishrecord component. -
createdBy
private final int createdByThe field for thecreatedByrecord component. -
createdAt
The field for thecreatedAtrecord 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 aPunishmentLogrecord class.- Parameters:
id- the value for theidrecord componentaction- the value for theactionrecord componentuserId- the value for theuserIdrecord componentipAddress- the value for theipAddressrecord componentreasonId- the value for thereasonIdrecord componentreasonTypeId- the value for thereasonTypeIdrecord componentreasonText- the value for thereasonTextrecord componentreasonDuration- the value for thereasonDurationrecord componentreasonAutoFlagIp- the value for thereasonAutoFlagIprecord componentreasonAutoPunish- the value for thereasonAutoPunishrecord componentcreatedBy- the value for thecreatedByrecord componentcreatedAt- the value for thecreatedAtrecord component
-
-
Method Details
-
expiresAt
-
isExpired
public boolean isExpired() -
isPermanent
public boolean isPermanent() -
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
action
Returns the value of theactionrecord component.- Returns:
- the value of the
actionrecord component
-
userId
Returns the value of theuserIdrecord component.- Returns:
- the value of the
userIdrecord component
-
ipAddress
Returns the value of theipAddressrecord component.- Returns:
- the value of the
ipAddressrecord component
-
reasonId
Returns the value of thereasonIdrecord component.- Returns:
- the value of the
reasonIdrecord component
-
reasonTypeId
public int reasonTypeId()Returns the value of thereasonTypeIdrecord component.- Returns:
- the value of the
reasonTypeIdrecord component
-
reasonText
Returns the value of thereasonTextrecord component.- Returns:
- the value of the
reasonTextrecord component
-
reasonDuration
Returns the value of thereasonDurationrecord component.- Returns:
- the value of the
reasonDurationrecord component
-
reasonAutoFlagIp
public boolean reasonAutoFlagIp()Returns the value of thereasonAutoFlagIprecord component.- Returns:
- the value of the
reasonAutoFlagIprecord component
-
reasonAutoPunish
public boolean reasonAutoPunish()Returns the value of thereasonAutoPunishrecord component.- Returns:
- the value of the
reasonAutoPunishrecord component
-
createdBy
public int createdBy()Returns the value of thecreatedByrecord component.- Returns:
- the value of the
createdByrecord component
-
createdAt
Returns the value of thecreatedAtrecord component.- Returns:
- the value of the
createdAtrecord component
-