Class MetaserverEntry
java.lang.Object
com.realtime.crossfire.jxclient.metaserver.MetaserverEntry
- All Implemented Interfaces:
Comparable<MetaserverEntry>
Represents a response line from the metaserver.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(@NotNull MetaserverEntry o) boolean
@NotNull String
Returns a formatted string using the given format.@NotNull String
Returns the server's arch base.long
Returns the number of bytes received.long
Returns the number of bytes sent.@NotNull String
Returns the server's code base.@NotNull String
Returns the server comment.@NotNull String
Returns the hostname.@NotNull String
getKey()
Returns the unique key for this entry.@NotNull String
Returns the server's map base.int
Returns the number of players.int
Returns the time since last update in seconds.int
Returns the server's uptime in seconds.@NotNull String
Returns the server version.int
hashCode()
@NotNull String
toString()
-
Constructor Details
-
MetaserverEntry
public MetaserverEntry(int updateSeconds, @NotNull @NotNull String hostname, int players, @NotNull @NotNull String version, @NotNull @NotNull String comment, long bytesIn, long bytesOut, int uptimeSeconds, @NotNull @NotNull String archBase, @NotNull @NotNull String mapBase, @NotNull @NotNull String codeBase) Creates a new instance.- Parameters:
updateSeconds
- time since last update in secondshostname
- the hostnameplayers
- the number of playersversion
- the server versioncomment
- the server commentbytesIn
- the number of bytes receivedbytesOut
- the number of bytes sentuptimeSeconds
- the server's uptime in secondsarchBase
- the server's arch basemapBase
- the server's map basecodeBase
- the server's code base
-
-
Method Details
-
getUpdateSeconds
public int getUpdateSeconds()Returns the time since last update in seconds.- Returns:
- the time in seconds
-
getHostname
Returns the hostname.- Returns:
- the hostname
-
getPlayers
public int getPlayers()Returns the number of players.- Returns:
- the number of players
-
getVersion
Returns the server version.- Returns:
- the server version
-
getComment
Returns the server comment.- Returns:
- the server comment
-
getBytesIn
public long getBytesIn()Returns the number of bytes received.- Returns:
- the number of bytes received
-
getBytesOut
public long getBytesOut()Returns the number of bytes sent.- Returns:
- the number of bytes sent
-
getUptimeSeconds
public int getUptimeSeconds()Returns the server's uptime in seconds.- Returns:
- the server's uptime in seconds
-
getArchBase
Returns the server's arch base.- Returns:
- the server's arch base
-
getMapBase
Returns the server's map base.- Returns:
- the server's map base
-
getCodeBase
Returns the server's code base.- Returns:
- the server's code base
-
getKey
Returns the unique key for this entry.- Returns:
- the key
-
toString
-
compareTo
- Specified by:
compareTo
in interfaceComparable<MetaserverEntry>
-
hashCode
public int hashCode() -
equals
-
format
Returns a formatted string using the given format.Supported format strings:
- %% - a literal % character
- %A - arch base
- %C - server comment
- %D - server comment converted to plain text
- %E - code base
- %H - hostname
- %I - bytes in
- %M - map base
- %O - bytes out
- %P - number of players
- %T - uptime in seconds
- %U - time since last update in seconds
- %V - server version
- Parameters:
format
- the format- Returns:
- the formatted string
-