Record Class IdempotencyManager.CachedResponse
java.lang.Object
java.lang.Record
com.loomcache.server.handler.IdempotencyManager.CachedResponse
- Enclosing class:
IdempotencyManager
public static record IdempotencyManager.CachedResponse(IdempotencyManager.IdempotencyKey key, Message response, long completedAt, long expiresAt, boolean cpOperation)
extends Record
Record representing a cached response with metadata.
-
Constructor Summary
ConstructorsConstructorDescriptionCachedResponse(IdempotencyManager.IdempotencyKey key, Message response, long completedAt, long expiresAt, boolean cpOperation) Creates an instance of aCachedResponserecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of thecompletedAtrecord component.booleanReturns the value of thecpOperationrecord component.final booleanIndicates whether some other object is "equal to" this one.longReturns the value of theexpiresAtrecord component.final inthashCode()Returns a hash code value for this object.booleanisExpired(long currentTimeMs) Checks if this cached response has expired.key()Returns the value of thekeyrecord component.response()Returns the value of theresponserecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CachedResponse
public CachedResponse(IdempotencyManager.IdempotencyKey key, Message response, long completedAt, long expiresAt, boolean cpOperation) Creates an instance of aCachedResponserecord class.- Parameters:
key- the value for thekeyrecord componentresponse- the value for theresponserecord componentcompletedAt- the value for thecompletedAtrecord componentexpiresAt- the value for theexpiresAtrecord componentcpOperation- the value for thecpOperationrecord component
-
-
Method Details
-
isExpired
public boolean isExpired(long currentTimeMs) Checks if this cached response has expired. -
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. -
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
response
Returns the value of theresponserecord component.- Returns:
- the value of the
responserecord component
-
completedAt
public long completedAt()Returns the value of thecompletedAtrecord component.- Returns:
- the value of the
completedAtrecord component
-
expiresAt
public long expiresAt()Returns the value of theexpiresAtrecord component.- Returns:
- the value of the
expiresAtrecord component
-
cpOperation
public boolean cpOperation()Returns the value of thecpOperationrecord component.- Returns:
- the value of the
cpOperationrecord component
-