Record Class ReliableTopic.TopicMessage<T>
java.lang.Object
java.lang.Record
com.loomcache.server.datastructures.ReliableTopic.TopicMessage<T>
- Type Parameters:
T- the payload type- Record Components:
sequence- the monotonic sequence number assigned on publishtimestampMs- the wall-clock time of publish (epoch millis)payload- the message payloadpublisherId- optional identifier of the publisher
- Enclosing class:
ReliableTopic<T>
-
Constructor Summary
ConstructorsConstructorDescriptionTopicMessage(long sequence, long timestampMs, T payload, @Nullable String publisherId) Creates an instance of aTopicMessagerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.payload()Returns the value of thepayloadrecord component.@Nullable StringReturns the value of thepublisherIdrecord component.longsequence()Returns the value of thesequencerecord component.longReturns the value of thetimestampMsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TopicMessage
Creates an instance of aTopicMessagerecord class.- Parameters:
sequence- the value for thesequencerecord componenttimestampMs- the value for thetimestampMsrecord componentpayload- the value for thepayloadrecord componentpublisherId- the value for thepublisherIdrecord component
-
-
Method Details
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
sequence
-
timestampMs
public long timestampMs()Returns the value of thetimestampMsrecord component.- Returns:
- the value of the
timestampMsrecord component
-
payload
-
publisherId
Returns the value of thepublisherIdrecord component.- Returns:
- the value of the
publisherIdrecord component
-