Record Class TcpServer.ConnectionInfo
java.lang.Object
java.lang.Record
com.loomcache.server.network.TcpServer.ConnectionInfo
- Enclosing class:
TcpServer
-
Constructor Summary
ConstructorsConstructorDescriptionConnectionInfo(String remoteAddress, long connectedAtMs, long bytesReceived, long bytesSent, long lastActivityMs) Creates an instance of aConnectionInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of thebytesReceivedrecord component.longReturns the value of thebytesSentrecord component.longReturns the value of theconnectedAtMsrecord 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 thelastActivityMsrecord component.Returns the value of theremoteAddressrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ConnectionInfo
public ConnectionInfo(String remoteAddress, long connectedAtMs, long bytesReceived, long bytesSent, long lastActivityMs) Creates an instance of aConnectionInforecord class.- Parameters:
remoteAddress- the value for theremoteAddressrecord componentconnectedAtMs- the value for theconnectedAtMsrecord componentbytesReceived- the value for thebytesReceivedrecord componentbytesSent- the value for thebytesSentrecord componentlastActivityMs- the value for thelastActivityMsrecord 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. -
remoteAddress
Returns the value of theremoteAddressrecord component.- Returns:
- the value of the
remoteAddressrecord component
-
connectedAtMs
public long connectedAtMs()Returns the value of theconnectedAtMsrecord component.- Returns:
- the value of the
connectedAtMsrecord component
-
bytesReceived
public long bytesReceived()Returns the value of thebytesReceivedrecord component.- Returns:
- the value of the
bytesReceivedrecord component
-
bytesSent
public long bytesSent()Returns the value of thebytesSentrecord component.- Returns:
- the value of the
bytesSentrecord component
-
lastActivityMs
public long lastActivityMs()Returns the value of thelastActivityMsrecord component.- Returns:
- the value of the
lastActivityMsrecord component
-