Record Class Status.PlayerInfo
java.lang.Object
java.lang.Record
net.minestom.server.ping.Status.PlayerInfo
- Enclosing class:
Status
public static record Status.PlayerInfo(int onlinePlayers, int maxPlayers, List<NamedAndIdentified> sample)
extends Record
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPlayerInfo(int onlinePlayers, int maxPlayers) PlayerInfo(int onlinePlayers, int maxPlayers, List<NamedAndIdentified> sample) Creates an instance of aPlayerInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic Status.PlayerInfo.Builderbuilder()static Status.PlayerInfo.Builderbuilder(Status.PlayerInfo playerInfo) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of themaxPlayersrecord component.static Status.PlayerInfoonline(int maxSamples) static Status.PlayerInfointReturns the value of theonlinePlayersrecord component.sample()Returns the value of thesamplerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
-
Constructor Details
-
PlayerInfo
Creates an instance of aPlayerInforecord class.- Parameters:
onlinePlayers- the value for theonlinePlayersrecord componentmaxPlayers- the value for themaxPlayersrecord componentsample- the value for thesamplerecord component
-
PlayerInfo
public PlayerInfo(int onlinePlayers, int maxPlayers)
-
-
Method Details
-
onlineCount
-
online
- Parameters:
maxSamples- The maximum number of player entries to include in the sample- Returns:
- A
Status.PlayerInfocontaining the online count, and a sample of online players.
-
builder
-
builder
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
onlinePlayers
public int onlinePlayers()Returns the value of theonlinePlayersrecord component.- Returns:
- the value of the
onlinePlayersrecord component
-
maxPlayers
public int maxPlayers()Returns the value of themaxPlayersrecord component.- Returns:
- the value of the
maxPlayersrecord component
-
sample
Returns the value of thesamplerecord component.- Returns:
- the value of the
samplerecord component
-