Module org.elasticsearch.server
Record Class Heartbeat
java.lang.Object
java.lang.Record
org.elasticsearch.cluster.coordination.stateless.Heartbeat
- All Implemented Interfaces:
Writeable
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Constructor Summary
ConstructorDescriptionHeartbeat
(long term, long absoluteTimeInMillis) Creates an instance of aHeartbeat
record class.Heartbeat
(StreamInput in) -
Method Summary
Modifier and TypeMethodDescriptionlong
Returns the value of theabsoluteTimeInMillis
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
term()
Returns the value of theterm
record component.final String
toString()
Returns a string representation of this record class.void
writeTo
(StreamOutput out) Write this into the StreamOutput.
-
Constructor Details
-
Heartbeat
- Throws:
IOException
-
Heartbeat
public Heartbeat(long term, long absoluteTimeInMillis) Creates an instance of aHeartbeat
record class.- Parameters:
term
- the value for theterm
record componentabsoluteTimeInMillis
- the value for theabsoluteTimeInMillis
record component
-
-
Method Details
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- 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. All components in this record class are compared with '=='. -
term
public long term()Returns the value of theterm
record component.- Returns:
- the value of the
term
record component
-
absoluteTimeInMillis
public long absoluteTimeInMillis()Returns the value of theabsoluteTimeInMillis
record component.- Returns:
- the value of the
absoluteTimeInMillis
record component
-