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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionClientConnectionData
(UUID id, String username, String sessionToken, boolean newClient) Creates an instance of aClientConnectionData
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.id()
Returns the value of theid
record component.boolean
Returns the value of thenewClient
record component.Returns the value of thesessionToken
record component.final String
toString()
Returns a string representation of this record class.username()
Returns the value of theusername
record component.
-
Field Details
-
id
The field for theid
record component. -
username
The field for theusername
record component. -
sessionToken
The field for thesessionToken
record component. -
newClient
private final boolean newClientThe field for thenewClient
record component.
-
-
Constructor Details
-
ClientConnectionData
Creates an instance of aClientConnectionData
record class.- Parameters:
id
- the value for theid
record componentusername
- the value for theusername
record componentsessionToken
- the value for thesessionToken
record componentnewClient
- the value for thenewClient
record 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 '=='. -
id
Returns the value of theid
record component.- Returns:
- the value of the
id
record component
-
username
Returns the value of theusername
record component.- Returns:
- the value of the
username
record component
-
sessionToken
Returns the value of thesessionToken
record component.- Returns:
- the value of the
sessionToken
record component
-
newClient
public boolean newClient()Returns the value of thenewClient
record component.- Returns:
- the value of the
newClient
record component
-