Package com.enhancedechest.log
Record Class DiffLine
java.lang.Object
java.lang.Record
com.enhancedechest.log.DiffLine
One line of a CLOSE event's change summary: how the amount of a single item kind changed over the
visit.
delta > 0 means that many were put into the chest, delta < 0 that many taken
out. itemKey is a namespaced material key (e.g. minecraft:diamond).
Material-level on purpose. The summary totals by material, not by full item identity, so a swap of two differently-enchanted swords of the same material nets to zero here. That is a readable headline, not the source of truth: the exact before/after contents are the OPEN and CLOSE snapshots, viewable by clicking the entry. Keeping the summary at material level is what lets it render as a localized item name with no stored text and no per-viewer work at write time.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintdelta()Returns the value of thedeltarecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.itemKey()Returns the value of theitemKeyrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DiffLine
Creates an instance of aDiffLinerecord class.- Parameters:
itemKey- the value for theitemKeyrecord componentdelta- the value for thedeltarecord 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 '=='. -
itemKey
Returns the value of theitemKeyrecord component.- Returns:
- the value of the
itemKeyrecord component
-
delta
public int delta()Returns the value of thedeltarecord component.- Returns:
- the value of the
deltarecord component
-