Package com.jk.webstack.security
Class User
java.lang.Object
com.jk.webstack.security.User
- All Implemented Interfaces:
 Serializable,org.springframework.security.core.userdetails.UserDetails
@Entity
public class User
extends Object
implements org.springframework.security.core.userdetails.UserDetails, Serializable
This entity class represents a user in the application.
 
 This class implements the UserDetails interface, providing
 user-related information for authentication and authorization purposes.
- Version:
 - 1.0
 - Author:
 - Dr. Jalal H. Kiswani
 - See Also:
 
- 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionstatic Usercreate()This method creates a newUser.This method sets the user first name to the provided value.Collection<? extends org.springframework.security.core.GrantedAuthority>Returns the authorities granted to the user.Returns the user name used to authenticate the user.booleanIndicates whether the user's account has expired.booleanIndicates whether the user is locked or unlocked.booleanIndicates whether the user's credentials (password) has expired.booleanIndicates whether the user is enabled or disabled.This method sets the user last name to the provided value.This method sets the user name to the provided value.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.security.core.userdetails.UserDetails
getPassword 
- 
Constructor Details
- 
User
public User() 
 - 
 - 
Method Details
- 
create
This method creates a newUser.- Returns:
 - the newly created user.
 
 - 
username
This method sets the user name to the provided value.- Parameters:
 username- Specifies the new user name.- Returns:
 - the edited user instance.
 
 - 
firstname
This method sets the user first name to the provided value.- Parameters:
 firstname- Specifies the new user first name.- Returns:
 - the edited user instance.
 
 - 
lastname
This method sets the user last name to the provided value.- Parameters:
 lastname- Specifies the new user last name.- Returns:
 - the edited user instance.
 
 - 
getAuthorities
Returns the authorities granted to the user.- Specified by:
 getAuthoritiesin interfaceorg.springframework.security.core.userdetails.UserDetails- Returns:
 - the authorities, sorted by natural key.
 
 - 
getUsername
Returns the user name used to authenticate the user.- Specified by:
 getUsernamein interfaceorg.springframework.security.core.userdetails.UserDetails- Returns:
 - the user name.
 
 - 
isAccountNonExpired
public boolean isAccountNonExpired()Indicates whether the user's account has expired.An expired account cannot be authenticated.
- Specified by:
 isAccountNonExpiredin interfaceorg.springframework.security.core.userdetails.UserDetails- Returns:
 trueif the user's account is valid (non-expired),falseif no longer valid (expired).
 - 
isAccountNonLocked
public boolean isAccountNonLocked()Indicates whether the user is locked or unlocked.A locked user cannot be authenticated.
- Specified by:
 isAccountNonLockedin interfaceorg.springframework.security.core.userdetails.UserDetails- Returns:
 trueif the user is not locked,falseotherwise.
 - 
isCredentialsNonExpired
public boolean isCredentialsNonExpired()Indicates whether the user's credentials (password) has expired.Expired credentials prevent authentication.
- Specified by:
 isCredentialsNonExpiredin interfaceorg.springframework.security.core.userdetails.UserDetails- Returns:
 trueif the user's credentials are valid (non-expired),falseif no longer valid (expired)
 - 
isEnabled
public boolean isEnabled()Indicates whether the user is enabled or disabled.A disabled user cannot be authenticated.
- Specified by:
 isEnabledin interfaceorg.springframework.security.core.userdetails.UserDetails- Returns:
 trueif the user is enabled,falseotherwise.
 
 -