Package com.enhancedechest.log
Record Class LogWrite
java.lang.Object
java.lang.Record
com.enhancedechest.log.LogWrite
- Record Components:
owner- the chest ownerindex- 1-based chest indexactor- who opened it (owner, or an admin viewing)actorName- the actor's name at the time, ornullsize- slot count of the chestopenedAt- epoch millis the chest was openedclosedAt- epoch millis it was closeddiff- the change summary text (never empty — a visit that changed nothing is not written)snapshot- theContainerCodec-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 -
Method Summary
Modifier and TypeMethodDescriptionactor()Returns the value of theactorrecord component.@Nullable StringReturns the value of theactorNamerecord component.longclosedAt()Returns the value of theclosedAtrecord component.diff()Returns the value of thediffrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intindex()Returns the value of theindexrecord component.longopenedAt()Returns the value of theopenedAtrecord component.owner()Returns the value of theownerrecord component.intsize()Returns the value of thesizerecord component.byte[]snapshot()Returns the value of thesnapshotrecord component.final StringtoString()Returns a string representation of this record class.
-
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 aLogWriterecord class.- Parameters:
owner- the value for theownerrecord componentindex- the value for theindexrecord componentactor- the value for theactorrecord componentactorName- the value for theactorNamerecord componentsize- the value for thesizerecord componentopenedAt- the value for theopenedAtrecord componentclosedAt- the value for theclosedAtrecord componentdiff- the value for thediffrecord componentsnapshot- the value for thesnapshotrecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
owner
Returns the value of theownerrecord component.- Returns:
- the value of the
ownerrecord component
-
index
public int index()Returns the value of theindexrecord component.- Returns:
- the value of the
indexrecord component
-
actor
Returns the value of theactorrecord component.- Returns:
- the value of the
actorrecord component
-
actorName
Returns the value of theactorNamerecord component.- Returns:
- the value of the
actorNamerecord component
-
size
public int size()Returns the value of thesizerecord component.- Returns:
- the value of the
sizerecord component
-
openedAt
public long openedAt()Returns the value of theopenedAtrecord component.- Returns:
- the value of the
openedAtrecord component
-
closedAt
public long closedAt()Returns the value of theclosedAtrecord component.- Returns:
- the value of the
closedAtrecord component
-
diff
Returns the value of thediffrecord component.- Returns:
- the value of the
diffrecord component
-
snapshot
public byte[] snapshot()Returns the value of thesnapshotrecord component.- Returns:
- the value of the
snapshotrecord component
-