Class User
java.lang.Object
io.github.astrapi69.design.pattern.observer.chat.User
- All Implemented Interfaces:
IUser<User>
,Serializable
The class
User
represents a user in a chat application It implements the IUser
interface and provides methods to manage the user's identity, including their name and ID- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the application user associated with thisIUser
getId()
Gets the unique identifier for thisIUser
getName()
Gets the name of thisIUser
void
setApplicationUser
(User user) Sets the application user associated with thisIUser
void
Sets the ID number of the uservoid
Sets the name of the user
-
Constructor Details
-
User
Instantiates a new user with the given name and ID- Parameters:
name
- the name of the userid
- the ID number of the user
-
-
Method Details
-
getApplicationUser
Gets the application user associated with thisIUser
- Specified by:
getApplicationUser
in interfaceIUser<User>
- Returns:
- the application user
-
setApplicationUser
Sets the application user associated with thisIUser
- Specified by:
setApplicationUser
in interfaceIUser<User>
- Parameters:
user
- the new application user
-
getId
Gets the unique identifier for thisIUser
-
setId
Sets the ID number of the user- Parameters:
id
- the new ID number
-
getName
Gets the name of thisIUser
-
setName
Sets the name of the user- Parameters:
name
- the new name of the user
-