Record Class LogEntry

java.lang.Object
java.lang.Record
com.enhancedechest.log.LogEntry
Record Components:
id - row id, used to fetch the snapshot on click
openedAt - epoch millis the chest was opened
closedAt - epoch millis it was closed
actorName - last-known name of who did it, or null
index - 1-based chest index
size - slot count of the chest
diff - the change summary (always non-empty for a stored visit)

public record LogEntry(long id, long openedAt, long closedAt, @Nullable String actorName, int index, int size, List<DiffLine> diff) extends Record
One row of the chest log as shown in the /ee log GUI — everything a pane needs except the snapshot blob, which is left in the database and fetched only when the pane is actually clicked. Keeping the (potentially multi-KB) blob out of the list query is what lets a page of 45 entries load cheaply.

One entry is one visit: opened, changed, closed. There is no separate open/close event any more.

  • Constructor Summary

    Constructors
    Constructor
    Description
    LogEntry(long id, long openedAt, long closedAt, @Nullable String actorName, int index, int size, List<DiffLine> diff)
    Creates an instance of a LogEntry record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @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.
    long
    id()
    Returns the value of the id record component.
    int
    Returns the value of the index record component.
    long
    Returns the value of the openedAt record component.
    int
    Returns the value of the size 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

    • LogEntry

      public LogEntry(long id, long openedAt, long closedAt, @Nullable @Nullable String actorName, int index, int size, List<DiffLine> diff)
      Creates an instance of a LogEntry record class.
      Parameters:
      id - the value for the id record component
      openedAt - the value for the openedAt record component
      closedAt - the value for the closedAt record component
      actorName - the value for the actorName record component
      index - the value for the index record component
      size - the value for the size record component
      diff - the value for the diff 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.
    • id

      public long id()
      Returns the value of the id record component.
      Returns:
      the value of the id 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
    • actorName

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

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

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

      public List<DiffLine> diff()
      Returns the value of the diff record component.
      Returns:
      the value of the diff record component