Package net.minestom.server.ping
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, @NotNull 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, @NotNull List<NamedAndIdentified> sample) Creates an instance of aPlayerInfo
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull Status.PlayerInfo.Builder
builder()
static @NotNull Status.PlayerInfo.Builder
builder
(Status.PlayerInfo playerInfo) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
Returns the value of themaxPlayers
record component.static @NotNull Status.PlayerInfo
online
(int maxSamples) static @NotNull Status.PlayerInfo
int
Returns the value of theonlinePlayers
record component.@NotNull List
<NamedAndIdentified> sample()
Returns the value of thesample
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
CODEC
-
-
Constructor Details
-
PlayerInfo
public PlayerInfo(int onlinePlayers, int maxPlayers, @NotNull @NotNull List<NamedAndIdentified> sample) Creates an instance of aPlayerInfo
record class.- Parameters:
onlinePlayers
- the value for theonlinePlayers
record componentmaxPlayers
- the value for themaxPlayers
record componentsample
- the value for thesample
record 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.PlayerInfo
containing the online count, and a sample of online players.
-
builder
-
builder
-
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 '=='. -
onlinePlayers
public int onlinePlayers()Returns the value of theonlinePlayers
record component.- Returns:
- the value of the
onlinePlayers
record component
-
maxPlayers
public int maxPlayers()Returns the value of themaxPlayers
record component.- Returns:
- the value of the
maxPlayers
record component
-
sample
Returns the value of thesample
record component.- Returns:
- the value of the
sample
record component
-