Package com.btcvelocity.api.bridge
Record Class BridgeMessage.Health
java.lang.Object
java.lang.Record
com.btcvelocity.api.bridge.BridgeMessage.Health
- Record Components:
serverName- the name of the reporting servermspt- the milliseconds per tick the server is currently averagingtps- the ticks per second the server is currently averagingplayerCount- the number of players connected to the backendloadedWorlds- the list of worlds currently loaded on the backend
- All Implemented Interfaces:
BridgeMessage
- Enclosing interface:
BridgeMessage
public static record BridgeMessage.Health(String serverName, double mspt, double tps, int playerCount, List<String> loadedWorlds)
extends Record
implements BridgeMessage
Backend -> Proxy: a periodic health report from a backend server.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.btcvelocity.api.bridge.BridgeMessage
BridgeMessage.ConnectRequest, BridgeMessage.Health, BridgeMessage.PartyWarp, BridgeMessage.QueueJoin, BridgeMessage.QueueLeave, BridgeMessage.QueueStatusResponse, BridgeMessage.RequestStatus, BridgeMessage.WorldLoaded, BridgeMessage.WorldPreload, BridgeMessage.WorldUnloaded -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theloadedWorldsrecord component.doublemspt()Returns the value of themsptrecord component.intReturns the value of theplayerCountrecord component.Returns the value of theserverNamerecord component.final StringtoString()Returns a string representation of this record class.doubletps()Returns the value of thetpsrecord component.type()Returns the string discriminator used to route this message during (de)serialization.
-
Constructor Details
-
Health
public Health(String serverName, double mspt, double tps, int playerCount, List<String> loadedWorlds) Creates an instance of aHealthrecord class.- Parameters:
serverName- the value for theserverNamerecord componentmspt- the value for themsptrecord componenttps- the value for thetpsrecord componentplayerCount- the value for theplayerCountrecord componentloadedWorlds- the value for theloadedWorldsrecord component
-
-
Method Details
-
type
Description copied from interface:BridgeMessageReturns the string discriminator used to route this message during (de)serialization.- Specified by:
typein interfaceBridgeMessage- Returns:
- the message type identifier
-
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 '=='. -
serverName
Returns the value of theserverNamerecord component.- Returns:
- the value of the
serverNamerecord component
-
mspt
public double mspt()Returns the value of themsptrecord component.- Returns:
- the value of the
msptrecord component
-
tps
public double tps()Returns the value of thetpsrecord component.- Returns:
- the value of the
tpsrecord component
-
playerCount
public int playerCount()Returns the value of theplayerCountrecord component.- Returns:
- the value of the
playerCountrecord component
-
loadedWorlds
Returns the value of theloadedWorldsrecord component.- Returns:
- the value of the
loadedWorldsrecord component
-