Class User
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:
-
UserDetails- Serialized Form
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCollection<? extends org.springframework.security.core.GrantedAuthority>getId()Returns the user id.getLogin()Returns the loginReturns the passwordReturns the username.booleanChecks if the account is non expiredbooleanChecks if the account is non lockedbooleanChecks if the account credentials are non expiredbooleanChecks if the entity is enabledvoidSets the user id.voidSets the loginvoidsetPassword(String password) Sets the password
-
Constructor Details
-
User
Constructor for class User- Parameters:
userDTO- Data transfer object containing User entity information- See Also:
-
User
public User()
-
-
Method Details
-
getId
Returns the user id.- Returns:
- A Long representing the user id.
-
setId
Sets the user id.- Parameters:
id- The user's unique identifier.
-
getLogin
Returns the login- Returns:
- A string representing the user's system login.
-
setLogin
Sets the login- Parameters:
login- Must not be blank.
-
getPassword
Returns the password- Specified by:
getPasswordin interfaceorg.springframework.security.core.userdetails.UserDetails- Returns:
- A string representing the user's system password.
-
setPassword
Sets the password- Parameters:
password- Must not be blank.
-
getAuthorities
- Specified by:
getAuthoritiesin interfaceorg.springframework.security.core.userdetails.UserDetails
-
getUsername
Returns the username.- Specified by:
getUsernamein interfaceorg.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:
isAccountNonExpiredin interfaceorg.springframework.security.core.userdetails.UserDetails- Returns:
- true
-
isAccountNonLocked
public boolean isAccountNonLocked()Checks if the account is non locked- Specified by:
isAccountNonLockedin interfaceorg.springframework.security.core.userdetails.UserDetails- Returns:
- true
-
isCredentialsNonExpired
public boolean isCredentialsNonExpired()Checks if the account credentials are non expired- Specified by:
isCredentialsNonExpiredin interfaceorg.springframework.security.core.userdetails.UserDetails- Returns:
- true
-
isEnabled
public boolean isEnabled()Checks if the entity is enabled- Specified by:
isEnabledin interfaceorg.springframework.security.core.userdetails.UserDetails- Returns:
- true
-