Record Class MessageLease
java.lang.Object
java.lang.Record
org.j7m.middleware.api.messaging.MessageLease
- Record Components:
envelope- leased message envelopeleaseId- lease identityconsumerId- owning consumerleaseUntil- lease expiration instant
- All Implemented Interfaces:
Serializable
public record MessageLease(MessageEnvelope envelope, LeaseId leaseId, ConsumerId consumerId, Instant leaseUntil)
extends Record
implements Serializable
Leased message returned to a consumer.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMessageLease(MessageEnvelope envelope, LeaseId leaseId, ConsumerId consumerId, Instant leaseUntil) Creates a message lease. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconsumerIdrecord component.envelope()Returns the value of theenveloperecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.leaseId()Returns the value of theleaseIdrecord component.Returns the value of theleaseUntilrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MessageLease
public MessageLease(MessageEnvelope envelope, LeaseId leaseId, ConsumerId consumerId, Instant leaseUntil) Creates a message lease.- Throws:
IllegalArgumentException- when any component is null
-
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
envelope
-
leaseId
-
consumerId
Returns the value of theconsumerIdrecord component.- Returns:
- the value of the
consumerIdrecord component
-
leaseUntil
Returns the value of theleaseUntilrecord component.- Returns:
- the value of the
leaseUntilrecord component
-