Package dev.agenor.tools.history
Record Class MessageHistoryService.StoredMessage
java.lang.Object
java.lang.Record
dev.agenor.tools.history.MessageHistoryService.StoredMessage
- Enclosing class:
MessageHistoryService
public static record MessageHistoryService.StoredMessage(String id, String topic, String senderId, String receiverId, String correlationId, Object payload, Map<String,String> headers, Instant timestamp, Instant storedAt)
extends Record
Stored message wrapper with additional metadata.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecorrelationIdrecord component.final booleanIndicates whether some other object is "equal to" this one.Creates a StoredMessage from a Message.final inthashCode()Returns a hash code value for this object.headers()Returns the value of theheadersrecord component.id()Returns the value of theidrecord component.payload()Returns the value of thepayloadrecord component.Returns the value of thereceiverIdrecord component.senderId()Returns the value of thesenderIdrecord component.storedAt()Returns the value of thestoredAtrecord component.Returns the value of thetimestamprecord component.toMap()Converts to a Map for JSON serialization.topic()Returns the value of thetopicrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
StoredMessage
public StoredMessage(String id, String topic, String senderId, String receiverId, String correlationId, Object payload, Map<String, String> headers, Instant timestamp, Instant storedAt) Creates an instance of aStoredMessagerecord class.- Parameters:
id- the value for theidrecord componenttopic- the value for thetopicrecord componentsenderId- the value for thesenderIdrecord componentreceiverId- the value for thereceiverIdrecord componentcorrelationId- the value for thecorrelationIdrecord componentpayload- the value for thepayloadrecord componentheaders- the value for theheadersrecord componenttimestamp- the value for thetimestamprecord componentstoredAt- the value for thestoredAtrecord component
-
-
Method Details
-
from
Creates a StoredMessage from a Message. -
toMap
Converts to a Map for JSON serialization. -
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). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
topic
Returns the value of thetopicrecord component.- Returns:
- the value of the
topicrecord component
-
senderId
Returns the value of thesenderIdrecord component.- Returns:
- the value of the
senderIdrecord component
-
receiverId
Returns the value of thereceiverIdrecord component.- Returns:
- the value of the
receiverIdrecord component
-
correlationId
Returns the value of thecorrelationIdrecord component.- Returns:
- the value of the
correlationIdrecord component
-
payload
Returns the value of thepayloadrecord component.- Returns:
- the value of the
payloadrecord component
-
headers
Returns the value of theheadersrecord component.- Returns:
- the value of the
headersrecord component
-
timestamp
Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-
storedAt
Returns the value of thestoredAtrecord component.- Returns:
- the value of the
storedAtrecord component
-