Record Class RaftLog.IndexTermPair
java.lang.Object
java.lang.Record
com.loomcache.server.consensus.RaftLog.IndexTermPair
- Enclosing class:
RaftLog
Immutable pair of (index, term) from the Raft log.
-
Constructor Summary
ConstructorsConstructorDescriptionIndexTermPair(long index, long term) Creates an instance of aIndexTermPairrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal 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
-
IndexTermPair
public IndexTermPair(long index, long term) Creates an instance of aIndexTermPairrecord class.- Parameters:
index- the value for theindexrecord componentterm- the value for thetermrecord 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. All components in this record class 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
-