Record Class Moderation

java.lang.Object
java.lang.Record
net.flectone.pulse.model.util.Moderation

public record Moderation(int id, int player, long date, long time, String reason, int moderator, Moderation.Type type, boolean valid, String server) extends Record
  • Field Details

  • Constructor Details

    • Moderation

      public Moderation(int id, int player, long date, long time, String reason, int moderator, String typeName, boolean valid, String server)
    • Moderation

      public Moderation(int id, int player, long date, long time, String reason, int moderator, Moderation.Type type, boolean valid, String server)
      Creates an instance of a Moderation record class.
      Parameters:
      id - the value for the id record component
      player - the value for the player record component
      date - the value for the date record component
      time - the value for the time record component
      reason - the value for the reason record component
      moderator - the value for the moderator record component
      type - the value for the type record component
      valid - the value for the valid record component
      server - the value for the server record component
  • Method Details

    • isActive

      public boolean isActive()
    • isPermanent

      public boolean isPermanent()
    • isExpired

      public boolean isExpired()
    • getRemainingTime

      public long getRemainingTime()
    • getOriginalTime

      public long getOriginalTime()
    • equals

      public boolean equals(Moderation moderation)
    • withId

      public Moderation withId(int id)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withPlayer

      public Moderation withPlayer(int player)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withDate

      public Moderation withDate(long date)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withTime

      public Moderation withTime(long time)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withReason

      public Moderation withReason(String reason)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withModerator

      public Moderation withModerator(int moderator)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withType

      public Moderation withType(Moderation.Type type)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withValid

      public Moderation withValid(boolean valid)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withServer

      public Moderation withServer(String server)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • 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 the compare method from their corresponding wrapper classes.
      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
    • player

      public int player()
      Returns the value of the player record component.
      Returns:
      the value of the player record component
    • date

      public long date()
      Returns the value of the date record component.
      Returns:
      the value of the date record component
    • time

      public long time()
      Returns the value of the time record component.
      Returns:
      the value of the time record component
    • reason

      public String reason()
      Returns the value of the reason record component.
      Returns:
      the value of the reason record component
    • moderator

      public int moderator()
      Returns the value of the moderator record component.
      Returns:
      the value of the moderator record component
    • type

      public Moderation.Type type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • valid

      public boolean valid()
      Returns the value of the valid record component.
      Returns:
      the value of the valid record component
    • server

      public String server()
      Returns the value of the server record component.
      Returns:
      the value of the server record component