Record Class SessionRecord
java.lang.Object
java.lang.Record
io.github.protasm.jvmud.engine.identity.SessionRecord
public record SessionRecord(SessionId id, PlayerId playerId, Optional<String> remoteAddress, Instant connectedAt, Instant lastActivityAt, Optional<PersonaId> attachedPersonaId)
extends Record
Engine-owned record for a connection and transport context.
A Session is bound to a Player as soon as the connection is known. It may remain unattached to any Persona during login, reconnect, or character selection.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattachedPersonaIdrecord component.Returns the value of theconnectedAtrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.Returns the value of thelastActivityAtrecord component.playerId()Returns the value of theplayerIdrecord component.Returns the value of theremoteAddressrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SessionRecord
public SessionRecord(SessionId id, PlayerId playerId, Optional<String> remoteAddress, Instant connectedAt, Instant lastActivityAt, Optional<PersonaId> attachedPersonaId) Creates an instance of aSessionRecordrecord class.- Parameters:
id- the value for theidrecord componentplayerId- the value for theplayerIdrecord componentremoteAddress- the value for theremoteAddressrecord componentconnectedAt- the value for theconnectedAtrecord componentlastActivityAt- the value for thelastActivityAtrecord componentattachedPersonaId- the value for theattachedPersonaIdrecord component
-
SessionRecord
-
-
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). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
playerId
Returns the value of theplayerIdrecord component.- Returns:
- the value of the
playerIdrecord component
-
remoteAddress
-
connectedAt
Returns the value of theconnectedAtrecord component.- Returns:
- the value of the
connectedAtrecord component
-
lastActivityAt
Returns the value of thelastActivityAtrecord component.- Returns:
- the value of the
lastActivityAtrecord component
-
attachedPersonaId
-