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).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final record -
Constructor Summary
ConstructorsConstructorDescriptionBCServerInfo(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 aBCServerInforecord class. -
Method Summary
Modifier and TypeMethodDescription_icon()Returns the value of the_iconrecord component.Returns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thegameVersionrecord component.final inthashCode()Returns a hash code value for this object.Optional<byte[]>icon()booleanisPublic()Returns the value of theisPublicrecord component.longReturns the value of thelastPingTimerecord component.name()Returns the value of thenamerecord component.booleanReturns the value of theonlineModerecord component.intReturns the value of theplayerCountrecord component.intReturns the value of theplayerLimitrecord component.players()Returns the value of theplayersrecord component.protocol()Returns the value of theprotocolrecord component.socket()Returns the value of thesocketrecord component.software()Returns the value of thesoftwarerecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thev1Versionrecord component.Returns the value of theversionCategoryrecord component.
-
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 aBCServerInforecord class.- Parameters:
name- the value for thenamerecord componentdescription- the value for thedescriptionrecord component_icon- the value for the_iconrecord componentisPublic- the value for theisPublicrecord componentsoftware- the value for thesoftwarerecord componentplayerLimit- the value for theplayerLimitrecord componentplayerCount- the value for theplayerCountrecord componentplayers- the value for theplayersrecord componentlastPingTime- the value for thelastPingTimerecord componentversionCategory- the value for theversionCategoryrecord componentgameVersion- the value for thegameVersionrecord componentprotocol- the value for theprotocolrecord componentsocket- the value for thesocketrecord componentv1Version- the value for thev1Versionrecord componentonlineMode- the value for theonlineModerecord component
-
-
Method Details
-
icon
-
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 '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
_icon
Returns the value of the_iconrecord component.- Returns:
- the value of the
_iconrecord component
-
isPublic
@SerializedName("is_public") public boolean isPublic()Returns the value of theisPublicrecord component.- Returns:
- the value of the
isPublicrecord component
-
software
Returns the value of thesoftwarerecord component.- Returns:
- the value of the
softwarerecord component
-
playerLimit
@SerializedName("max_players") public int playerLimit()Returns the value of theplayerLimitrecord component.- Returns:
- the value of the
playerLimitrecord component
-
playerCount
@SerializedName("online_players") public int playerCount()Returns the value of theplayerCountrecord component.- Returns:
- the value of the
playerCountrecord component
-
players
Returns the value of theplayersrecord component.- Returns:
- the value of the
playersrecord component
-
lastPingTime
@SerializedName("last_ping_time") public long lastPingTime()Returns the value of thelastPingTimerecord component.- Returns:
- the value of the
lastPingTimerecord component
-
versionCategory
Returns the value of theversionCategoryrecord component.- Returns:
- the value of the
versionCategoryrecord component
-
gameVersion
Returns the value of thegameVersionrecord component.- Returns:
- the value of the
gameVersionrecord component
-
protocol
Returns the value of theprotocolrecord component.- Returns:
- the value of the
protocolrecord component
-
socket
Returns the value of thesocketrecord component.- Returns:
- the value of the
socketrecord component
-
v1Version
Returns the value of thev1Versionrecord component.- Returns:
- the value of the
v1Versionrecord component
-
onlineMode
@SerializedName("online_mode") public boolean onlineMode()Returns the value of theonlineModerecord component.- Returns:
- the value of the
onlineModerecord component
-