Record Class BanInfo

java.lang.Object
java.lang.Record
lol.trq.alts.model.BanInfo
Record Components:
banned - whether the account is currently considered banned
observedAt - the epoch-millis the ban was observed
source - how it was observed — e.g. "self" (banned while playing) or "login"
detail - the ban message or reason, if one was captured
observedBy - the member id (Ed25519 identity) that witnessed the ban in a shared repo, or null when observed locally / unattributed

public record BanInfo(boolean banned, long observedAt, String source, String detail, String observedBy) extends Record
A locally-observed ban record for an account on one server. Servers expose no ban-status API, so this is not a lookup — it is set when the client witnesses a ban: the player gets banned while on this account, or logs into an account already flagged. Stored per server in AltAccount's bans map (keyed by server id), so the row can show which servers burned it, and shared into a repository so members coordinate.
Since:
0.1.0
  • Constructor Details

    • BanInfo

      public BanInfo(boolean banned, long observedAt, String source, String detail, String observedBy)
      Creates an instance of a BanInfo record class.
      Parameters:
      banned - the value for the banned record component
      observedAt - the value for the observedAt record component
      source - the value for the source record component
      detail - the value for the detail record component
      observedBy - the value for the observedBy record component
  • Method Details

    • observed

      public static BanInfo observed(String source, String detail)
      Creates a ban record stamped at the current time, unattributed.
      Parameters:
      source - how the ban was observed
      detail - the ban message or reason, or null
      Returns:
      a banned record stamped now
      Since:
      0.1.0
    • observed

      public static BanInfo observed(String source, String detail, String byMember)
      Creates a ban record stamped at the current time, attributed to the observing member.
      Parameters:
      source - how the ban was observed
      detail - the ban message or reason, or null
      byMember - the member id (Ed25519 identity) that witnessed the ban, or null
      Returns:
      a banned record stamped now, attributed to byMember
      Since:
      0.1.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. 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.
    • banned

      @SerializedName("banned") public boolean banned()
      Returns the value of the banned record component.
      Returns:
      the value of the banned record component
    • observedAt

      @SerializedName("observedAt") public long observedAt()
      Returns the value of the observedAt record component.
      Returns:
      the value of the observedAt record component
    • source

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

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

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