Class MetaserverEntry
- java.lang.Object
-
- com.realtime.crossfire.jxclient.metaserver.MetaserverEntry
-
- All Implemented Interfaces:
java.lang.Comparable<MetaserverEntry>
public class MetaserverEntry extends java.lang.Object implements java.lang.Comparable<MetaserverEntry>
Represents a response line from the metaserver.
-
-
Constructor Summary
Constructors Constructor Description MetaserverEntry(int updateSeconds, @NotNull java.lang.String hostname, int players, @NotNull java.lang.String version, @NotNull java.lang.String comment, long bytesIn, long bytesOut, int uptimeSeconds, @NotNull java.lang.String archBase, @NotNull java.lang.String mapBase, @NotNull java.lang.String codeBase)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(@NotNull MetaserverEntry o)booleanequals(@Nullable java.lang.Object obj)@NotNull java.lang.Stringformat(@NotNull java.lang.String format)Returns a formatted string using the given format.@NotNull java.lang.StringgetArchBase()Returns the server's arch base.longgetBytesIn()Returns the number of bytes received.longgetBytesOut()Returns the number of bytes sent.@NotNull java.lang.StringgetCodeBase()Returns the server's code base.@NotNull java.lang.StringgetComment()Returns the server comment.@NotNull java.lang.StringgetHostname()Returns the hostname.@NotNull java.lang.StringgetMapBase()Returns the server's map base.intgetPlayers()Returns the number of players.intgetUpdateSeconds()Returns the time since last update in seconds.intgetUptimeSeconds()Returns the server's uptime in seconds.@NotNull java.lang.StringgetVersion()Returns the server version.inthashCode()@NotNull java.lang.StringtoString()
-
-
-
Constructor Detail
-
MetaserverEntry
public MetaserverEntry(int updateSeconds, @NotNull @NotNull java.lang.String hostname, int players, @NotNull @NotNull java.lang.String version, @NotNull @NotNull java.lang.String comment, long bytesIn, long bytesOut, int uptimeSeconds, @NotNull @NotNull java.lang.String archBase, @NotNull @NotNull java.lang.String mapBase, @NotNull @NotNull java.lang.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 Detail
-
getUpdateSeconds
public int getUpdateSeconds()
Returns the time since last update in seconds.- Returns:
- the time in seconds
-
getHostname
@NotNull public @NotNull java.lang.String getHostname()
Returns the hostname.- Returns:
- the hostname
-
getPlayers
public int getPlayers()
Returns the number of players.- Returns:
- the number of players
-
getVersion
@NotNull public @NotNull java.lang.String getVersion()
Returns the server version.- Returns:
- the server version
-
getComment
@NotNull public @NotNull java.lang.String 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
@NotNull public @NotNull java.lang.String getArchBase()
Returns the server's arch base.- Returns:
- the server's arch base
-
getMapBase
@NotNull public @NotNull java.lang.String getMapBase()
Returns the server's map base.- Returns:
- the server's map base
-
getCodeBase
@NotNull public @NotNull java.lang.String getCodeBase()
Returns the server's code base.- Returns:
- the server's code base
-
toString
@NotNull public @NotNull java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
compareTo
public int compareTo(@NotNull @NotNull MetaserverEntry o)- Specified by:
compareToin interfacejava.lang.Comparable<MetaserverEntry>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(@Nullable @Nullable java.lang.Object obj)- Overrides:
equalsin classjava.lang.Object
-
format
@NotNull public @NotNull java.lang.String format(@NotNull @NotNull java.lang.String 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
-
-