Record Class SnapshotManager.Snapshot
java.lang.Object
java.lang.Record
com.loomcache.server.persistence.SnapshotManager.Snapshot
- Enclosing class:
SnapshotManager
public static record SnapshotManager.Snapshot(long lastIncludedIndex, long lastIncludedTerm, long timestamp, long checksum, byte[] data)
extends Record
Snapshot record containing index, term, timestamp, checksum, and data.
-
Constructor Summary
ConstructorsConstructorDescriptionSnapshot(long lastIncludedIndex, long lastIncludedTerm, long timestamp, long checksum, byte[] data) Creates an instance of aSnapshotrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongchecksum()Returns the value of thechecksumrecord component.byte[]data()Returns the value of thedatarecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longReturns the value of thelastIncludedIndexrecord component.longReturns the value of thelastIncludedTermrecord component.longReturns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Snapshot
public Snapshot(long lastIncludedIndex, long lastIncludedTerm, long timestamp, long checksum, byte[] data) Creates an instance of aSnapshotrecord class.- Parameters:
lastIncludedIndex- the value for thelastIncludedIndexrecord componentlastIncludedTerm- the value for thelastIncludedTermrecord componenttimestamp- the value for thetimestamprecord componentchecksum- the value for thechecksumrecord componentdata- the value for thedatarecord component
-
-
Method Details
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
lastIncludedIndex
public long lastIncludedIndex()Returns the value of thelastIncludedIndexrecord component.- Returns:
- the value of the
lastIncludedIndexrecord component
-
lastIncludedTerm
public long lastIncludedTerm()Returns the value of thelastIncludedTermrecord component.- Returns:
- the value of the
lastIncludedTermrecord component
-
timestamp
public long timestamp()Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-
checksum
public long checksum()Returns the value of thechecksumrecord component.- Returns:
- the value of the
checksumrecord component
-
data
public byte[] data()Returns the value of thedatarecord component.- Returns:
- the value of the
datarecord component
-