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 Details

    • UserProfile

      public UserProfile()
  • Method Details

    • getAuthorities

      public Collection<? extends org.springframework.security.core.GrantedAuthority> 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 interface org.springframework.security.core.userdetails.UserDetails
      Returns:
      a collection of granted authorities.
    • getUsername

      public String getUsername()
      Returns the username used for authentication. In this implementation, the email address serves as the username.
      Specified by:
      getUsername in interface org.springframework.security.core.userdetails.UserDetails
      Returns:
      the email address of the user.
    • getPassword

      public String getPassword()
      Returns the password used for authentication.
      Specified by:
      getPassword in interface org.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 interface org.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 interface org.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 interface org.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 interface org.springframework.security.core.userdetails.UserDetails
      Returns:
      true if the account is enabled, false otherwise.