Record Class DistributedTopic.MessageWithSequence<T>
java.lang.Object
java.lang.Record
com.loomcache.server.topic.DistributedTopic.MessageWithSequence<T>
- Type Parameters:
T- The message type
- Enclosing class:
DistributedTopic<T>
-
Constructor Summary
ConstructorsConstructorDescriptionMessageWithSequence(T message, long sequence) Validate that sequence is positive. -
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.message()Returns the value of themessagerecord component.longsequence()Returns the value of thesequencerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MessageWithSequence
Validate that sequence is positive.- Throws:
IllegalArgumentException- if sequence invalid input: '<'= 0
-
-
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. -
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-
sequence
public long sequence()Returns the value of thesequencerecord component.- Returns:
- the value of the
sequencerecord component
-