Record Class PlayerAttributes.Ban

java.lang.Object
java.lang.Record
lol.trq.alts.account.PlayerAttributes.Ban
Record Components:
banId - the ban's id
expires - when the ban lifts, or null for a ban with no stated end
reason - the service's reason code
reasonMessage - the service's human-readable reason, when it gave one
Enclosing class:
PlayerAttributes

public static record PlayerAttributes.Ban(String banId, Instant expires, String reason, String reasonMessage) extends Record
One ban, as listed under a scope.
Since:
0.12.0
  • Constructor Details

    • Ban

      public Ban(String banId, Instant expires, String reason, String reasonMessage)
      Creates an instance of a Ban record class.
      Parameters:
      banId - the value for the banId record component
      expires - the value for the expires record component
      reason - the value for the reason record component
      reasonMessage - the value for the reasonMessage record component
  • Method Details

    • permanent

      public boolean permanent()
      Returns whether the ban has no stated end.
      Returns:
      true if no expiry was given
      Since:
      0.12.0
    • activeAt

      public boolean activeAt(Instant now)
      Returns whether the ban is in force at the given instant.
      Parameters:
      now - the instant to measure against
      Returns:
      true if the ban is permanent or has not yet expired
      Since:
      0.12.0
    • 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.
    • banId

      @SerializedName("banId") public String banId()
      Returns the value of the banId record component.
      Returns:
      the value of the banId record component
    • expires

      @SerializedName("expires") public Instant expires()
      Returns the value of the expires record component.
      Returns:
      the value of the expires record component
    • reason

      @SerializedName("reason") public String reason()
      Returns the value of the reason record component.
      Returns:
      the value of the reason record component
    • reasonMessage

      @SerializedName("reasonMessage") public String reasonMessage()
      Returns the value of the reasonMessage record component.
      Returns:
      the value of the reasonMessage record component