Package io.atomix.raft.protocol
Record Class ReplicatableJournalRecord
java.lang.Object
java.lang.Record
io.atomix.raft.protocol.ReplicatableJournalRecord
- All Implemented Interfaces:
ReplicatableRaftRecord
public record ReplicatableJournalRecord(long term, long index, long checksum, byte[] serializedJournalRecord)
extends Record
implements ReplicatableRaftRecord
-
Constructor Summary
ConstructorsConstructorDescriptionReplicatableJournalRecord(long term, long index, long checksum, byte[] serializedJournalRecord) Creates an instance of aReplicatableJournalRecordrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the approximate size needed when serializing this class.longchecksum()Returns the value of thechecksumrecord component.booleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.longindex()Returns the value of theindexrecord component.byte[]Returns the value of theserializedJournalRecordrecord component.longterm()Returns the value of thetermrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
ReplicatableJournalRecord
public ReplicatableJournalRecord(long term, long index, long checksum, byte[] serializedJournalRecord) Creates an instance of aReplicatableJournalRecordrecord class.- Parameters:
term- the value for thetermrecord componentindex- the value for theindexrecord componentchecksum- the value for thechecksumrecord componentserializedJournalRecord- the value for theserializedJournalRecordrecord component
-
-
Method Details
-
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 '=='. -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. -
approximateSize
public int approximateSize()Returns the approximate size needed when serializing this class. The exact size depends on the serializer.- Returns:
- approximate size
-
term
public long term()Returns the value of thetermrecord component.- Specified by:
termin interfaceReplicatableRaftRecord- Returns:
- the value of the
termrecord component
-
index
public long index()Returns the value of theindexrecord component.- Specified by:
indexin interfaceReplicatableRaftRecord- Returns:
- the value of the
indexrecord component
-
checksum
public long checksum()Returns the value of thechecksumrecord component.- Returns:
- the value of the
checksumrecord component
-
serializedJournalRecord
public byte[] serializedJournalRecord()Returns the value of theserializedJournalRecordrecord component.- Returns:
- the value of the
serializedJournalRecordrecord component
-