Record Class TcpServer.ServerHealthStatus

java.lang.Object
java.lang.Record
com.loomcache.server.network.TcpServer.ServerHealthStatus
Enclosing class:
TcpServer

public static record TcpServer.ServerHealthStatus(long uptimeMs, int totalConnections, int activeConnections, int droppedConnections, TcpServer.BandwidthStats bandwidth) extends Record
Server health status snapshot. Includes uptime, connection counts, and bandwidth statistics.
  • Constructor Details

    • ServerHealthStatus

      public ServerHealthStatus(long uptimeMs, int totalConnections, int activeConnections, int droppedConnections, TcpServer.BandwidthStats bandwidth)
      Creates an instance of a ServerHealthStatus record class.
      Parameters:
      uptimeMs - the value for the uptimeMs record component
      totalConnections - the value for the totalConnections record component
      activeConnections - the value for the activeConnections record component
      droppedConnections - the value for the droppedConnections record component
      bandwidth - the value for the bandwidth record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • uptimeMs

      public long uptimeMs()
      Returns the value of the uptimeMs record component.
      Returns:
      the value of the uptimeMs record component
    • totalConnections

      public int totalConnections()
      Returns the value of the totalConnections record component.
      Returns:
      the value of the totalConnections record component
    • activeConnections

      public int activeConnections()
      Returns the value of the activeConnections record component.
      Returns:
      the value of the activeConnections record component
    • droppedConnections

      public int droppedConnections()
      Returns the value of the droppedConnections record component.
      Returns:
      the value of the droppedConnections record component
    • bandwidth

      public TcpServer.BandwidthStats bandwidth()
      Returns the value of the bandwidth record component.
      Returns:
      the value of the bandwidth record component