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 aDefaultLogEntry
record class. -
Method Summary
Modifier and TypeMethodDescriptioncommand()
Returns the value of thecommand
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.long
index()
Returns the value of theindex
record component.static DefaultLogEntry
static DefaultLogEntry
readFrom
(ObjectInput in) long
term()
Returns the value of theterm
record component.final String
toString()
Returns a string representation of this record class.static void
writeTo
(LogEntry entry, ObjectOutput out)
-
Constructor Details
-
DefaultLogEntry
Creates an instance of aDefaultLogEntry
record class.- Parameters:
index
- the value for theindex
record componentterm
- the value for theterm
record componentcommand
- the value for thecommand
record component
-
-
Method Details
-
of
-
readFrom
- Throws:
IOException
ClassNotFoundException
-
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 theindex
record component. -
term
public long term()Returns the value of theterm
record component. -
command
Returns the value of thecommand
record component.
-