Record Class PunishmentRequest

java.lang.Object
java.lang.Record
dev.plex.api.punishment.PunishmentRequest
Record Components:
punished - UUID of the player being punished
punisher - UUID of the actor issuing the punishment
source - source that issued the punishment
punisherReference - source-specific actor reference
ip - IP address associated with the punished player
type - punishment type to apply
reason - punishment reason
endDate - punishment end date, or null for instant punishments; fixed-duration types replace this value

public record PunishmentRequest(UUID punished, @Nullable UUID punisher, PunishmentSource source, @Nullable String punisherReference, @Nullable String ip, PunishmentType type, String reason, @Nullable ZonedDateTime endDate) extends Record
Request payload used to create a punishment for a player.
  • Constructor Details

  • Method Details

    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • punished

      public UUID punished()
      Returns the value of the punished record component.
      Returns:
      the value of the punished record component
    • punisher

      @Nullable public @Nullable UUID punisher()
      Returns the value of the punisher record component.
      Returns:
      the value of the punisher record component
    • source

      public PunishmentSource source()
      Returns the value of the source record component.
      Returns:
      the value of the source record component
    • punisherReference

      @Nullable public @Nullable String punisherReference()
      Returns the value of the punisherReference record component.
      Returns:
      the value of the punisherReference record component
    • ip

      @Nullable public @Nullable String ip()
      Returns the value of the ip record component.
      Returns:
      the value of the ip record component
    • type

      public PunishmentType type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • reason

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

      @Nullable public @Nullable ZonedDateTime endDate()
      Returns the value of the endDate record component.
      Returns:
      the value of the endDate record component