Record Class BCServerInfo

java.lang.Object
java.lang.Record
de.florianmichael.classic4j.model.betacraft.BCServerInfo

public record BCServerInfo(String name, String description, String _icon, boolean isPublic, BCServerInfo.Software software, int playerLimit, int playerCount, BCServerInfo.Player[] players, long lastPingTime, BCVersionCategory versionCategory, String gameVersion, String protocol, String socket, String v1Version, boolean onlineMode) extends Record
This class represents a server on the BetaCraft server list (API v2).
  • Constructor Details

    • BCServerInfo

      public BCServerInfo(String name, String description, String _icon, boolean isPublic, BCServerInfo.Software software, int playerLimit, int playerCount, BCServerInfo.Player[] players, long lastPingTime, BCVersionCategory versionCategory, String gameVersion, String protocol, String socket, String v1Version, boolean onlineMode)
      Creates an instance of a BCServerInfo record class.
      Parameters:
      name - the value for the name record component
      description - the value for the description record component
      _icon - the value for the _icon record component
      isPublic - the value for the isPublic record component
      software - the value for the software record component
      playerLimit - the value for the playerLimit record component
      playerCount - the value for the playerCount record component
      players - the value for the players record component
      lastPingTime - the value for the lastPingTime record component
      versionCategory - the value for the versionCategory record component
      gameVersion - the value for the gameVersion record component
      protocol - the value for the protocol record component
      socket - the value for the socket record component
      v1Version - the value for the v1Version record component
      onlineMode - the value for the onlineMode record component
  • Method Details

    • icon

      public Optional<byte[]> icon()
    • 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 '=='.
      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.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • description

      public String description()
      Returns the value of the description record component.
      Returns:
      the value of the description record component
    • _icon

      @SerializedName("icon") public String _icon()
      Returns the value of the _icon record component.
      Returns:
      the value of the _icon record component
    • isPublic

      @SerializedName("is_public") public boolean isPublic()
      Returns the value of the isPublic record component.
      Returns:
      the value of the isPublic record component
    • software

      public BCServerInfo.Software software()
      Returns the value of the software record component.
      Returns:
      the value of the software record component
    • playerLimit

      @SerializedName("max_players") public int playerLimit()
      Returns the value of the playerLimit record component.
      Returns:
      the value of the playerLimit record component
    • playerCount

      @SerializedName("online_players") public int playerCount()
      Returns the value of the playerCount record component.
      Returns:
      the value of the playerCount record component
    • players

      @SerializedName("players") public BCServerInfo.Player[] players()
      Returns the value of the players record component.
      Returns:
      the value of the players record component
    • lastPingTime

      @SerializedName("last_ping_time") public long lastPingTime()
      Returns the value of the lastPingTime record component.
      Returns:
      the value of the lastPingTime record component
    • versionCategory

      @SerializedName("category") public BCVersionCategory versionCategory()
      Returns the value of the versionCategory record component.
      Returns:
      the value of the versionCategory record component
    • gameVersion

      @SerializedName("game_version") public String gameVersion()
      Returns the value of the gameVersion record component.
      Returns:
      the value of the gameVersion record component
    • protocol

      public String protocol()
      Returns the value of the protocol record component.
      Returns:
      the value of the protocol record component
    • socket

      public String socket()
      Returns the value of the socket record component.
      Returns:
      the value of the socket record component
    • v1Version

      @SerializedName("v1_version") public String v1Version()
      Returns the value of the v1Version record component.
      Returns:
      the value of the v1Version record component
    • onlineMode

      @SerializedName("online_mode") public boolean onlineMode()
      Returns the value of the onlineMode record component.
      Returns:
      the value of the onlineMode record component