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
  • Field Details

  • Constructor Details

    • PlayerInfo

      public PlayerInfo(int onlinePlayers, int maxPlayers, @NotNull @NotNull List<NamedAndIdentified> sample)
      Creates an instance of a PlayerInfo record class.
      Parameters:
      onlinePlayers - the value for the onlinePlayers record component
      maxPlayers - the value for the maxPlayers record component
      sample - the value for the sample record component
    • PlayerInfo

      public PlayerInfo(int onlinePlayers, int maxPlayers)
  • Method Details

    • onlineCount

      @NotNull public static @NotNull Status.PlayerInfo onlineCount()
    • online

      @NotNull public static @NotNull Status.PlayerInfo online(int maxSamples)
      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

      @NotNull public static @NotNull Status.PlayerInfo.Builder builder()
    • builder

      @NotNull public static @NotNull Status.PlayerInfo.Builder builder(Status.PlayerInfo playerInfo)
    • 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.
    • onlinePlayers

      public int onlinePlayers()
      Returns the value of the onlinePlayers record component.
      Returns:
      the value of the onlinePlayers record component
    • maxPlayers

      public int maxPlayers()
      Returns the value of the maxPlayers record component.
      Returns:
      the value of the maxPlayers record component
    • sample

      @NotNull public @NotNull List<NamedAndIdentified> sample()
      Returns the value of the sample record component.
      Returns:
      the value of the sample record component