Record Class ConnectionLostEvent
java.lang.Object
java.lang.Record
com.botwithus.bot.api.event.ConnectionLostEvent
- Record Components:
connectionName- the originating connection namecause- the throwable that surfaced the disconnect, ornullif the disconnect was inferred without an exception (e.g. EOF on a clean shutdown)timestamp- event creation time in milliseconds since epoch
- All Implemented Interfaces:
GameEvent
public record ConnectionLostEvent(String connectionName, Throwable cause, long timestamp)
extends Record
implements GameEvent
Fired when the underlying pipe transport drops mid-session. The producer
(the
ReconnectController) publishes this exactly once per
disconnect, before transitioning the ReconnectState machine to
Disconnected/Reconnecting.-
Constructor Summary
ConstructorsConstructorDescriptionConnectionLostEvent(String connectionName, Throwable cause) ConnectionLostEvent(String connectionName, Throwable cause, long timestamp) Creates an instance of aConnectionLostEventrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncause()Returns the value of thecauserecord component.Returns the value of theconnectionNamerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longReturns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ConnectionLostEvent
-
ConnectionLostEvent
Creates an instance of aConnectionLostEventrecord class.- Parameters:
connectionName- the value for theconnectionNamerecord componentcause- the value for thecauserecord componenttimestamp- the value for thetimestamprecord component
-
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
connectionName
Returns the value of theconnectionNamerecord component.- Returns:
- the value of the
connectionNamerecord component
-
cause
-
timestamp
-