Record Class PunishmentReason
java.lang.Object
java.lang.Record
de.murmelmeister.murmelapi.punishment.reason.PunishmentReason
- Record Components:
durationSecs- Duration in seconds, null for permanent reasons
public record PunishmentReason(int id, int typeId, String reasonText, Long durationSecs, boolean autoFlagIp, boolean autoPunish, int createdBy, LocalDateTime createdAt, Integer changedBy, LocalDateTime changedAt)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanThe field for theautoFlagIprecord component.private final booleanThe field for theautoPunishrecord component.private final LocalDateTimeThe field for thechangedAtrecord component.private final IntegerThe field for thechangedByrecord component.private final LocalDateTimeThe field for thecreatedAtrecord component.private final intThe field for thecreatedByrecord component.private final LongThe field for thedurationSecsrecord component.private final intThe field for theidrecord component.private final StringThe field for thereasonTextrecord component.private final intThe field for thetypeIdrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionPunishmentReason(int id, int typeId, String reasonText, Long durationSecs, boolean autoFlagIp, boolean autoPunish, int createdBy, LocalDateTime createdAt, Integer changedBy, LocalDateTime changedAt) Creates an instance of aPunishmentReasonrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theautoFlagIprecord component.booleanReturns the value of theautoPunishrecord component.Returns the value of thechangedAtrecord component.Returns the value of thechangedByrecord component.Returns the value of thecreatedAtrecord component.intReturns the value of thecreatedByrecord component.Returns the value of thedurationSecsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intid()Returns the value of theidrecord component.booleanReturns the value of thereasonTextrecord component.final StringtoString()Returns a string representation of this record class.inttypeId()Returns the value of thetypeIdrecord component.withUpdateMeta(Integer typeId, String reasonText, Long durationSecs, Boolean autoFlagIp, Boolean autoPunish, Integer changedBy, LocalDateTime changedAt)
-
Field Details
-
id
private final int idThe field for theidrecord component. -
typeId
private final int typeIdThe field for thetypeIdrecord component. -
reasonText
The field for thereasonTextrecord component. -
durationSecs
The field for thedurationSecsrecord component. -
autoFlagIp
private final boolean autoFlagIpThe field for theautoFlagIprecord component. -
autoPunish
private final boolean autoPunishThe field for theautoPunishrecord component. -
createdBy
private final int createdByThe field for thecreatedByrecord component. -
createdAt
The field for thecreatedAtrecord component. -
changedBy
The field for thechangedByrecord component. -
changedAt
The field for thechangedAtrecord component.
-
-
Constructor Details
-
PunishmentReason
public PunishmentReason(int id, int typeId, String reasonText, Long durationSecs, boolean autoFlagIp, boolean autoPunish, int createdBy, LocalDateTime createdAt, Integer changedBy, LocalDateTime changedAt) Creates an instance of aPunishmentReasonrecord class.- Parameters:
id- the value for theidrecord componenttypeId- the value for thetypeIdrecord componentreasonText- the value for thereasonTextrecord componentdurationSecs- the value for thedurationSecsrecord componentautoFlagIp- the value for theautoFlagIprecord componentautoPunish- the value for theautoPunishrecord componentcreatedBy- the value for thecreatedByrecord componentcreatedAt- the value for thecreatedAtrecord componentchangedBy- the value for thechangedByrecord componentchangedAt- the value for thechangedAtrecord component
-
-
Method Details
-
isPermanent
public boolean isPermanent() -
withUpdateMeta
public PunishmentReason withUpdateMeta(Integer typeId, String reasonText, Long durationSecs, Boolean autoFlagIp, Boolean autoPunish, Integer changedBy, LocalDateTime changedAt) -
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
public int id()Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
typeId
public int typeId()Returns the value of thetypeIdrecord component.- Returns:
- the value of the
typeIdrecord component
-
reasonText
Returns the value of thereasonTextrecord component.- Returns:
- the value of the
reasonTextrecord component
-
durationSecs
Returns the value of thedurationSecsrecord component.- Returns:
- the value of the
durationSecsrecord component
-
autoFlagIp
public boolean autoFlagIp()Returns the value of theautoFlagIprecord component.- Returns:
- the value of the
autoFlagIprecord component
-
autoPunish
public boolean autoPunish()Returns the value of theautoPunishrecord component.- Returns:
- the value of the
autoPunishrecord 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
-
changedBy
Returns the value of thechangedByrecord component.- Returns:
- the value of the
changedByrecord component
-
changedAt
Returns the value of thechangedAtrecord component.- Returns:
- the value of the
changedAtrecord component
-