Package com.usatiuk.kleppmanntree
Record Class CombinedTimestamp<TimestampT extends Comparable<TimestampT>,PeerIdT extends Comparable<PeerIdT>>
java.lang.Object
java.lang.Record
com.usatiuk.kleppmanntree.CombinedTimestamp<TimestampT,PeerIdT>
- Type Parameters:
TimestampT
- the type of the timestampPeerIdT
- the type of the node ID- Record Components:
timestamp
- the timestampnodeId
- the node ID. If null, then only the timestamp is used for ordering.
- All Implemented Interfaces:
Serializable
,Comparable<CombinedTimestamp<TimestampT,
PeerIdT>>
public record CombinedTimestamp<TimestampT extends Comparable<TimestampT>,PeerIdT extends Comparable<PeerIdT>> (TimestampT extends Comparable<TimestampT> timestamp, PeerIdT extends Comparable<PeerIdT> nodeId)
extends Record
implements Comparable<CombinedTimestamp<TimestampT,PeerIdT>>, Serializable
CombinedTimestamp is a record that represents a timestamp and a node ID, ordered first by timestamp and then by node ID.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCombinedTimestamp
(TimestampT timestamp, PeerIdT nodeId) Creates an instance of aCombinedTimestamp
record class. -
Method Summary
Modifier and TypeMethodDescriptionint
final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.nodeId()
Returns the value of thenodeId
record component.Returns the value of thetimestamp
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
compareTo
- Specified by:
compareTo
in interfaceComparable<TimestampT extends Comparable<TimestampT>>
-
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 withObjects::equals(Object,Object)
. -
timestamp
Returns the value of thetimestamp
record component.- Returns:
- the value of the
timestamp
record component
-
nodeId
Returns the value of thenodeId
record component.- Returns:
- the value of the
nodeId
record component
-