Record Class RaftMetadataStore.RaftMetadata
java.lang.Object
java.lang.Record
com.loomcache.server.persistence.RaftMetadataStore.RaftMetadata
- Record Components:
currentTerm- the persisted termvotedFor- the persisted vote, or nullcommitIndex- the persisted durable commit boundary
- Enclosing class:
RaftMetadataStore
-
Constructor Summary
ConstructorsConstructorDescriptionRaftMetadata(long currentTerm, @Nullable String votedFor, long commitIndex) Creates an instance of aRaftMetadatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of thecommitIndexrecord component.longReturns the value of thecurrentTermrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.@Nullable StringvotedFor()Returns the value of thevotedForrecord component.
-
Constructor Details
-
RaftMetadata
Creates an instance of aRaftMetadatarecord class.- Parameters:
currentTerm- the value for thecurrentTermrecord componentvotedFor- the value for thevotedForrecord componentcommitIndex- the value for thecommitIndexrecord 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. -
currentTerm
public long currentTerm()Returns the value of thecurrentTermrecord component.- Returns:
- the value of the
currentTermrecord component
-
votedFor
-
commitIndex
public long commitIndex()Returns the value of thecommitIndexrecord component.- Returns:
- the value of the
commitIndexrecord component
-