Class MetaserverEntry

java.lang.Object
com.realtime.crossfire.jxclient.metaserver.MetaserverEntry
All Implemented Interfaces:
Comparable<MetaserverEntry>

public class MetaserverEntry extends Object implements Comparable<MetaserverEntry>
Represents a response line from the metaserver.
  • 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 seconds
      hostname - the hostname
      players - the number of players
      version - the server version
      comment - the server comment
      bytesIn - the number of bytes received
      bytesOut - the number of bytes sent
      uptimeSeconds - the server's uptime in seconds
      archBase - the server's arch base
      mapBase - the server's map base
      codeBase - 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

      @NotNull public @NotNull 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 String getVersion()
      Returns the server version.
      Returns:
      the server version
    • getComment

      @NotNull public @NotNull 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 String getArchBase()
      Returns the server's arch base.
      Returns:
      the server's arch base
    • getMapBase

      @NotNull public @NotNull String getMapBase()
      Returns the server's map base.
      Returns:
      the server's map base
    • getCodeBase

      @NotNull public @NotNull String getCodeBase()
      Returns the server's code base.
      Returns:
      the server's code base
    • getKey

      @NotNull public @NotNull String getKey()
      Returns the unique key for this entry.
      Returns:
      the key
    • toString

      @NotNull public @NotNull String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(@NotNull @NotNull MetaserverEntry o)
      Specified by:
      compareTo in interface Comparable<MetaserverEntry>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(@Nullable @Nullable Object obj)
      Overrides:
      equals in class Object
    • format

      @NotNull public @NotNull String format(@NotNull @NotNull 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