Record Class DefaultLogEntry
java.lang.Object
java.lang.Record
org.opendaylight.controller.cluster.raft.spi.DefaultLogEntry
@NonNullByDefault
public record DefaultLogEntry(long index, long term, StateMachineCommand command)
extends Record
implements Immutable, LogEntry
Default
LogEntry implementation.-
Constructor Summary
ConstructorsConstructorDescriptionDefaultLogEntry(long index, long term, StateMachineCommand command) Creates an instance of aDefaultLogEntryrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncommand()Returns the value of thecommandrecord 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.static DefaultLogEntrystatic DefaultLogEntryreadFrom(ObjectInput in) longterm()Returns the value of thetermrecord component.final StringtoString()Returns a string representation of this record class.static voidwriteTo(LogEntry entry, ObjectOutput out)
-
Constructor Details
-
DefaultLogEntry
Creates an instance of aDefaultLogEntryrecord class.- Parameters:
index- the value for theindexrecord componentterm- the value for thetermrecord componentcommand- the value for thecommandrecord component
-
-
Method Details
-
of
-
readFrom
- Throws:
IOExceptionClassNotFoundException
-
writeTo
- Throws:
IOException
-
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. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
index
public long index()Returns the value of theindexrecord component. -
term
public long term()Returns the value of thetermrecord component. -
command
Returns the value of thecommandrecord component.
-