Record Class LogWrite

java.lang.Object
java.lang.Record
com.enhancedechest.log.LogWrite
Record Components:
owner - the chest owner
index - 1-based chest index
actor - who opened it (owner, or an admin viewing)
actorName - the actor's name at the time, or null
size - slot count of the chest
openedAt - epoch millis the chest was opened
closedAt - epoch millis it was closed
diff - the change summary text (never empty — a visit that changed nothing is not written)
snapshot - the ContainerCodec-encoded contents as the chest was left

public record LogWrite(UUID owner, int index, UUID actor, @Nullable String actorName, int size, long openedAt, long closedAt, String diff, byte[] snapshot) extends Record
One immutable unit of work handed from a Bukkit-owned thread to the log writer thread: a completed visit ready to insert. One row is written per visit (at close), never per open — the snapshot is the chest as it was left, and the diff is what changed while it was open. Everything here is already primitive/immutable, so it crosses the thread boundary with no Bukkit object and no further main-thread work.
  • Constructor Summary

    Constructors
    Constructor
    Description
    LogWrite(UUID owner, int index, UUID actor, @Nullable String actorName, int size, long openedAt, long closedAt, String diff, byte[] snapshot)
    Creates an instance of a LogWrite record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the actor record component.
    @Nullable String
    Returns the value of the actorName record component.
    long
    Returns the value of the closedAt record component.
    Returns the value of the diff record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the index record component.
    long
    Returns the value of the openedAt record component.
    Returns the value of the owner record component.
    int
    Returns the value of the size record component.
    byte[]
    Returns the value of the snapshot record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • LogWrite

      public LogWrite(UUID owner, int index, UUID actor, @Nullable @Nullable String actorName, int size, long openedAt, long closedAt, String diff, byte[] snapshot)
      Creates an instance of a LogWrite record class.
      Parameters:
      owner - the value for the owner record component
      index - the value for the index record component
      actor - the value for the actor record component
      actorName - the value for the actorName record component
      size - the value for the size record component
      openedAt - the value for the openedAt record component
      closedAt - the value for the closedAt record component
      diff - the value for the diff record component
      snapshot - the value for the snapshot record component
  • 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. 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.
    • owner

      public UUID owner()
      Returns the value of the owner record component.
      Returns:
      the value of the owner record component
    • index

      public int index()
      Returns the value of the index record component.
      Returns:
      the value of the index record component
    • actor

      public UUID actor()
      Returns the value of the actor record component.
      Returns:
      the value of the actor record component
    • actorName

      @Nullable public @Nullable String actorName()
      Returns the value of the actorName record component.
      Returns:
      the value of the actorName record component
    • size

      public int size()
      Returns the value of the size record component.
      Returns:
      the value of the size record component
    • openedAt

      public long openedAt()
      Returns the value of the openedAt record component.
      Returns:
      the value of the openedAt record component
    • closedAt

      public long closedAt()
      Returns the value of the closedAt record component.
      Returns:
      the value of the closedAt record component
    • diff

      public String diff()
      Returns the value of the diff record component.
      Returns:
      the value of the diff record component
    • snapshot

      public byte[] snapshot()
      Returns the value of the snapshot record component.
      Returns:
      the value of the snapshot record component