java.lang.Object
com.mirna.hospitalmanagementapi.domain.entities.auth.User
All Implemented Interfaces:
Serializable, org.springframework.security.core.userdetails.UserDetails

@Entity(name="User") public class User extends Object implements org.springframework.security.core.userdetails.UserDetails
Version:
1.0
Author:
Mirna Gama
See Also:
  • Constructor Details

    • User

      public User(UserDTO userDTO)
      Constructor for class User
      Parameters:
      userDTO - Data transfer object containing User entity information
      See Also:
    • User

      public User()
  • Method Details

    • getId

      public Long getId()
      Returns the user id.
      Returns:
      A Long representing the user id.
    • setId

      public void setId(Long id)
      Sets the user id.
      Parameters:
      id - The user's unique identifier.
    • getLogin

      public String getLogin()
      Returns the login
      Returns:
      A string representing the user's system login.
    • setLogin

      public void setLogin(String login)
      Sets the login
      Parameters:
      login - Must not be blank.
    • getPassword

      public String getPassword()
      Returns the password
      Specified by:
      getPassword in interface org.springframework.security.core.userdetails.UserDetails
      Returns:
      A string representing the user's system password.
    • setPassword

      public void setPassword(String password)
      Sets the password
      Parameters:
      password - Must not be blank.
    • getAuthorities

      public Collection<? extends org.springframework.security.core.GrantedAuthority> getAuthorities()
      Specified by:
      getAuthorities in interface org.springframework.security.core.userdetails.UserDetails
    • getUsername

      public String getUsername()
      Returns the username.
      Specified by:
      getUsername in interface org.springframework.security.core.userdetails.UserDetails
      Returns:
      A string containing the user's system login
    • isAccountNonExpired

      public boolean isAccountNonExpired()
      Checks if the account is non expired
      Specified by:
      isAccountNonExpired in interface org.springframework.security.core.userdetails.UserDetails
      Returns:
      true
    • isAccountNonLocked

      public boolean isAccountNonLocked()
      Checks if the account is non locked
      Specified by:
      isAccountNonLocked in interface org.springframework.security.core.userdetails.UserDetails
      Returns:
      true
    • isCredentialsNonExpired

      public boolean isCredentialsNonExpired()
      Checks if the account credentials are non expired
      Specified by:
      isCredentialsNonExpired in interface org.springframework.security.core.userdetails.UserDetails
      Returns:
      true
    • isEnabled

      public boolean isEnabled()
      Checks if the entity is enabled
      Specified by:
      isEnabled in interface org.springframework.security.core.userdetails.UserDetails
      Returns:
      true