Record Class SnapshotStore.SnapshotMetadata
java.lang.Object
java.lang.Record
com.loomcache.server.persistence.SnapshotStore.SnapshotMetadata
- Enclosing class:
SnapshotStore
public static record SnapshotStore.SnapshotMetadata(long index, long term, byte[] data, byte[] checksum)
extends Record
Snapshot metadata record with SHA-256 checksum for validation.
-
Constructor Summary
ConstructorsConstructorDescriptionSnapshotMetadata(long index, long term, byte[] data) Create metadata without checksum.SnapshotMetadata(long index, long term, byte[] data, byte[] checksum) Creates an instance of aSnapshotMetadatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]checksum()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.longindex()Returns the value of theindexrecord component.longterm()Returns the value of thetermrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SnapshotMetadata
public SnapshotMetadata(long index, long term, byte[] data) Create metadata without checksum.- Parameters:
index- the snapshot indexterm- the snapshot termdata- the snapshot data
-
SnapshotMetadata
public SnapshotMetadata(long index, long term, byte[] data, byte[] checksum) Creates an instance of aSnapshotMetadatarecord class.- Parameters:
index- the value for theindexrecord componentterm- the value for thetermrecord componentdata- the value for thedatarecord componentchecksum- the value for thechecksumrecord 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. -
index
public long index()Returns the value of theindexrecord component.- Returns:
- the value of the
indexrecord component
-
term
public long term()Returns the value of thetermrecord component.- Returns:
- the value of the
termrecord component
-
data
public byte[] data()Returns the value of thedatarecord component.- Returns:
- the value of the
datarecord component
-
checksum
public byte[] checksum()Returns the value of thechecksumrecord component.- Returns:
- the value of the
checksumrecord component
-