Package devs.beer.nativepackets.api
Record Class StatusPlayers
java.lang.Object
java.lang.Record
devs.beer.nativepackets.api.StatusPlayers
Optional player-count and sample section of a server status response.
-
Constructor Summary
ConstructorsConstructorDescriptionStatusPlayers(int maximum, int online, List<NativeGameProfile> sample) Creates an instance of aStatusPlayersrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intmaximum()Returns the value of themaximumrecord component.intonline()Returns the value of theonlinerecord component.sample()Returns the value of thesamplerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
StatusPlayers
Creates an instance of aStatusPlayersrecord class.- Parameters:
maximum- the value for themaximumrecord componentonline- the value for theonlinerecord componentsample- the value for thesamplerecord component
-
-
Method Details
-
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 '=='. -
maximum
public int maximum()Returns the value of themaximumrecord component.- Returns:
- the value of the
maximumrecord component
-
online
public int online()Returns the value of theonlinerecord component.- Returns:
- the value of the
onlinerecord component
-
sample
Returns the value of thesamplerecord component.- Returns:
- the value of the
samplerecord component
-