Package game.service
Record Class User
java.lang.Object
java.lang.Record
game.service.User
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclientID()
Returns the value of theclientID
record component.final boolean
Indicates whether some other object is "equal to" this one.boolean
guest()
Returns the value of theguest
record component.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.username()
Returns the value of theusername
record component.
-
Constructor Details
-
User
Creates an instance of aUser
record class.- Parameters:
username
- the value for theusername
record componentclientID
- the value for theclientID
record componentguest
- the value for theguest
record component
-
-
Method Details
-
username
Returns the value of theusername
record component.- Returns:
- the value of the
username
record component
-
clientID
Returns the value of theclientID
record component.- Returns:
- the value of the
clientID
record component
-
guest
public boolean guest()Returns the value of theguest
record component.- Returns:
- the value of the
guest
record component
-
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 '=='.
-