Record Class CloudPlayer

java.lang.Object
java.lang.Record
cloud.spawnery.agent.api.CloudPlayer
Record Components:
server - empty when the proxy has them and no backend does: during the login handshake, and between one backend and the next. It is not an error and a plugin must handle it. On a backend it is also empty for a player on an on-demand server, whose name only the proxies are told.

public record CloudPlayer(UUID id, String name, Optional<String> server) extends Record
A player, and which backend they are on.
  • Constructor Details

    • CloudPlayer

      public CloudPlayer(UUID id, String name, Optional<String> server)
      Creates an instance of a CloudPlayer record class.
      Parameters:
      id - the value for the id record component
      name - the value for the name record component
      server - the value for the server record component
  • Method Details

    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • id

      public UUID id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • server

      public Optional<String> server()
      Returns the value of the server record component.
      Returns:
      the value of the server record component