Package org.opendaylight.raft.api
Record Class EntryInfo
java.lang.Object
java.lang.Record
org.opendaylight.raft.api.EntryInfo
- Record Components:
index
- log entry indexterm
- log entry term
- All Implemented Interfaces:
EntryMeta
@NonNullByDefault
public record EntryInfo(long index, long term)
extends Record
implements EntryMeta
An immutable
EntryMeta
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal 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 EntryInfo
of
(long index, long term) Return anEntryInfo
with specified index and term.static EntryInfo
static @Nullable EntryInfo
ofNullable
(@Nullable EntryMeta meta) long
term()
Returns the value of theterm
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
EntryInfo
public EntryInfo(long index, long term) Default constructor.- Parameters:
index
- log entry indexterm
- log entry term
-
-
Method Details
-
of
Return anEntryInfo
with specified index and term.- Parameters:
index
- the indexterm
- the term- Returns:
- an
EntryInfo
-
of
-
ofNullable
-
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. All components in this record class 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.
-