Package api.mpba.rastvdmy.entity
Class UserProfile
java.lang.Object
api.mpba.rastvdmy.entity.UserProfile
- All Implemented Interfaces:
Serializable
,org.springframework.security.core.userdetails.UserDetails
@Entity
public class UserProfile
extends Object
implements org.springframework.security.core.userdetails.UserDetails, Serializable
This class represents a user profile in the banking system.
It implements UserDetails for Spring Security and contains
user-specific information such as role, status, personal details,
contact information, and relationships to other entities.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCollection
<? extends org.springframework.security.core.GrantedAuthority> Returns the authorities granted to the user.Returns the password used for authentication.Returns the username used for authentication.boolean
Indicates whether the user's account is non-expired.boolean
Indicates whether the user's account is non-locked.boolean
Indicates whether the user's credentials are non-expired.boolean
Indicates whether the user's account is enabled.
-
Constructor Details
-
UserProfile
public UserProfile()
-
-
Method Details
-
getAuthorities
Returns the authorities granted to the user. This method is required for Spring Security to manage user roles and permissions.- Specified by:
getAuthorities
in interfaceorg.springframework.security.core.userdetails.UserDetails
- Returns:
- a collection of granted authorities.
-
getUsername
Returns the username used for authentication. In this implementation, the email address serves as the username.- Specified by:
getUsername
in interfaceorg.springframework.security.core.userdetails.UserDetails
- Returns:
- the email address of the user.
-
getPassword
Returns the password used for authentication.- Specified by:
getPassword
in interfaceorg.springframework.security.core.userdetails.UserDetails
- Returns:
- the password of the user.
-
isAccountNonExpired
public boolean isAccountNonExpired()Indicates whether the user's account is non-expired. In this implementation, the account is always considered non-expired.- Specified by:
isAccountNonExpired
in interfaceorg.springframework.security.core.userdetails.UserDetails
- Returns:
- true if the account is non-expired, false otherwise.
-
isAccountNonLocked
public boolean isAccountNonLocked()Indicates whether the user's account is non-locked. In this implementation, the account is always considered non-locked.- Specified by:
isAccountNonLocked
in interfaceorg.springframework.security.core.userdetails.UserDetails
- Returns:
- true if the account is non-locked, false otherwise.
-
isCredentialsNonExpired
public boolean isCredentialsNonExpired()Indicates whether the user's credentials are non-expired. In this implementation, the credentials are always considered non-expired.- Specified by:
isCredentialsNonExpired
in interfaceorg.springframework.security.core.userdetails.UserDetails
- Returns:
- true if the credentials are non-expired, false otherwise.
-
isEnabled
public boolean isEnabled()Indicates whether the user's account is enabled. In this implementation, the account is always considered enabled.- Specified by:
isEnabled
in interfaceorg.springframework.security.core.userdetails.UserDetails
- Returns:
- true if the account is enabled, false otherwise.
-