Record Class DefaultLogEntry

java.lang.Object
java.lang.Record
org.opendaylight.controller.cluster.raft.spi.DefaultLogEntry
All Implemented Interfaces:
LogEntry, EntryMeta, Immutable

@NonNullByDefault public record DefaultLogEntry(long index, long term, StateMachineCommand command) extends Record implements Immutable, LogEntry
Default LogEntry implementation.
  • Constructor Details

    • DefaultLogEntry

      public DefaultLogEntry(long index, long term, StateMachineCommand command)
      Creates an instance of a DefaultLogEntry record class.
      Parameters:
      index - the value for the index record component
      term - the value for the term record component
      command - the value for the command record component
  • Method Details

    • of

      public static DefaultLogEntry of(LogEntry entry)
    • readFrom

      public static DefaultLogEntry readFrom(ObjectInput in) throws IOException, ClassNotFoundException
      Throws:
      IOException
      ClassNotFoundException
    • writeTo

      public static void writeTo(LogEntry entry, ObjectOutput out) throws IOException
      Throws:
      IOException
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • index

      public long index()
      Returns the value of the index record component.
      Specified by:
      index in interface EntryMeta
      Returns:
      the value of the index record component
    • term

      public long term()
      Returns the value of the term record component.
      Specified by:
      term in interface EntryMeta
      Returns:
      the value of the term record component
    • command

      public StateMachineCommand command()
      Returns the value of the command record component.
      Specified by:
      command in interface LogEntry
      Returns:
      the value of the command record component