Record Class TwoPhaseCommitInterceptor.MapEntry
java.lang.Object
java.lang.Record
org.apache.catalina.tribes.group.interceptors.TwoPhaseCommitInterceptor.MapEntry
- Record Components:
msg- the channel messageid- the unique identifiertimestamp- the arrival time
- Enclosing class:
TwoPhaseCommitInterceptor
public static record TwoPhaseCommitInterceptor.MapEntry(ChannelMessage msg, UniqueId id, long timestamp)
extends Record
Entry that holds a message, its ID, and the timestamp of arrival.
-
Constructor Summary
ConstructorsConstructorDescriptionMapEntry(ChannelMessage msg, UniqueId id, long timestamp) Creates an instance of aMapEntryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.booleanexpired(long now, long expiration) Checks if this entry has expired.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.msg()Returns the value of themsgrecord component.longReturns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
expired
public boolean expired(long now, long expiration) Checks if this entry has expired.- Parameters:
now- the current timeexpiration- the expiration period- Returns:
- true if expired
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
msg
Returns the value of themsgrecord component.- Returns:
- the value of the
msgrecord component
-
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
timestamp
public long timestamp()Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-