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 Details

    • id

      private final int id
      The field for the id record component.
    • typeId

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

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

      private final Long durationSecs
      The field for the durationSecs record component.
    • autoFlagIp

      private final boolean autoFlagIp
      The field for the autoFlagIp record component.
    • autoPunish

      private final boolean autoPunish
      The field for the autoPunish 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.
    • changedBy

      private final Integer changedBy
      The field for the changedBy record component.
    • changedAt

      private final LocalDateTime changedAt
      The field for the changedAt record 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 a PunishmentReason record class.
      Parameters:
      id - the value for the id record component
      typeId - the value for the typeId record component
      reasonText - the value for the reasonText record component
      durationSecs - the value for the durationSecs record component
      autoFlagIp - the value for the autoFlagIp record component
      autoPunish - the value for the autoPunish record component
      createdBy - the value for the createdBy record component
      createdAt - the value for the createdAt record component
      changedBy - the value for the changedBy record component
      changedAt - the value for the changedAt record 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

      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 int id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • typeId

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

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

      public Long durationSecs()
      Returns the value of the durationSecs record component.
      Returns:
      the value of the durationSecs record component
    • autoFlagIp

      public boolean autoFlagIp()
      Returns the value of the autoFlagIp record component.
      Returns:
      the value of the autoFlagIp record component
    • autoPunish

      public boolean autoPunish()
      Returns the value of the autoPunish record component.
      Returns:
      the value of the autoPunish 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
    • changedBy

      public Integer changedBy()
      Returns the value of the changedBy record component.
      Returns:
      the value of the changedBy record component
    • changedAt

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