Record Class ClientConnectionData

java.lang.Object
java.lang.Record
nl.andrewl.concord_server.client.ClientConnectionData
Record Components:
id - The user's unique id.
username - The user's unique username.
sessionToken - The user's new session token that can be used the next time they want to log in.
newClient - True if this client is connecting for the first time, or false otherwise.

public record ClientConnectionData(UUID id, String username, String sessionToken, boolean newClient) extends Record
Some common data that's used when dealing with a client who has just joined the server.
  • Field Details

    • id

      private final UUID id
      The field for the id record component.
    • username

      private final String username
      The field for the username record component.
    • sessionToken

      private final String sessionToken
      The field for the sessionToken record component.
    • newClient

      private final boolean newClient
      The field for the newClient record component.
  • Constructor Details

    • ClientConnectionData

      public ClientConnectionData(UUID id, String username, String sessionToken, boolean newClient)
      Creates an instance of a ClientConnectionData record class.
      Parameters:
      id - the value for the id record component
      username - the value for the username record component
      sessionToken - the value for the sessionToken record component
      newClient - the value for the newClient 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. 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.
    • id

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

      public String username()
      Returns the value of the username record component.
      Returns:
      the value of the username record component
    • sessionToken

      public String sessionToken()
      Returns the value of the sessionToken record component.
      Returns:
      the value of the sessionToken record component
    • newClient

      public boolean newClient()
      Returns the value of the newClient record component.
      Returns:
      the value of the newClient record component