java.lang.Object
io.github.astrapi69.design.pattern.observer.chat.User
All Implemented Interfaces:
IUser<User>, Serializable

public class User extends Object implements IUser<User>
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 Details

    • User

      public User(String name, Integer id)
      Instantiates a new user with the given name and ID
      Parameters:
      name - the name of the user
      id - the ID number of the user
  • Method Details

    • getApplicationUser

      public User getApplicationUser()
      Gets the application user associated with this IUser
      Specified by:
      getApplicationUser in interface IUser<User>
      Returns:
      the application user
    • setApplicationUser

      public void setApplicationUser(User user)
      Sets the application user associated with this IUser
      Specified by:
      setApplicationUser in interface IUser<User>
      Parameters:
      user - the new application user
    • getId

      public Integer getId()
      Gets the unique identifier for this IUser
      Specified by:
      getId in interface IUser<User>
      Returns:
      the unique identifier
    • setId

      public void setId(Integer id)
      Sets the ID number of the user
      Parameters:
      id - the new ID number
    • getName

      public String getName()
      Gets the name of this IUser
      Specified by:
      getName in interface IUser<User>
      Returns:
      the name of the user
    • setName

      public void setName(String name)
      Sets the name of the user
      Parameters:
      name - the new name of the user