Package net.carcdr.yhocuspocus.redis
Record Class MessageCodec.DecodedMessage
java.lang.Object
java.lang.Record
net.carcdr.yhocuspocus.redis.MessageCodec.DecodedMessage
- Record Components:
instanceId- the originating instance IDpayload- the message payload
- Enclosing class:
MessageCodec
A decoded message containing instance ID and payload.
-
Constructor Summary
ConstructorsConstructorDescriptionDecodedMessage(String instanceId, byte[] payload) Creates an instance of aDecodedMessagerecord 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.Returns the value of theinstanceIdrecord component.booleanChecks if this message originated from the given instance.byte[]payload()Returns the value of thepayloadrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DecodedMessage
Creates an instance of aDecodedMessagerecord class.- Parameters:
instanceId- the value for theinstanceIdrecord componentpayload- the value for thepayloadrecord component
-
-
Method Details
-
isFrom
Checks if this message originated from the given instance.- Parameters:
myInstanceId- the instance ID to check against- Returns:
- true if the message is from the specified instance
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
instanceId
Returns the value of theinstanceIdrecord component.- Returns:
- the value of the
instanceIdrecord component
-
payload
-