Class User
java.lang.Object
ntnu.idatt2016.v233.SmartMat.entity.user.User
- All Implemented Interfaces:
Serializable,org.springframework.security.core.userdetails.UserDetails
@Entity(name="users")
public class User
extends Object
implements org.springframework.security.core.userdetails.UserDetails
User is a class representing a user in the system.
It implements the UserDetails interface.
- Version:
- 2.0.3
- Author:
- Anders, Birk, Pedro
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAllergy(Allergy allergy) adds an allergy to the uservoidaddGroup(UserGroupAsso userGroupTable) adds a group to the uservoidadds a recipe to the userbooleandeleteAllergy(Allergy allergy) Deletes the specified allergy from this user's list of allergies.booleanCollection<? extends org.springframework.security.core.GrantedAuthority>used when created jwts and validating user authoritygetter for the user password used in userdetails servicegetter for the user username used in userdetails serviceinthashCode()booleannot usedbooleannot usedbooleannot usedbooleanused in authentication
-
Constructor Details
-
User
public User()
-
-
Method Details
-
addAllergy
adds an allergy to the user- Parameters:
allergy- the allergy to add to the user
-
deleteAllergy
Deletes the specified allergy from this user's list of allergies.- Parameters:
allergy- the allergy to delete- Returns:
- true if the allergy was successfully deleted, false otherwise
-
addRecipe
adds a recipe to the user- Parameters:
recipe- the recipe to add to the user
-
addGroup
adds a group to the user- Parameters:
userGroupTable- the userGroupTable to add to the user
-
getAuthorities
used when created jwts and validating user authority- Specified by:
getAuthoritiesin interfaceorg.springframework.security.core.userdetails.UserDetails- Returns:
- the users authority
-
getPassword
getter for the user password used in userdetails service- Specified by:
getPasswordin interfaceorg.springframework.security.core.userdetails.UserDetails- Returns:
- the users password
-
getUsername
getter for the user username used in userdetails service- Specified by:
getUsernamein interfaceorg.springframework.security.core.userdetails.UserDetails- Returns:
- the users username
-
isAccountNonExpired
public boolean isAccountNonExpired()not used- Specified by:
isAccountNonExpiredin interfaceorg.springframework.security.core.userdetails.UserDetails- Returns:
- true if the account is not expired
-
isAccountNonLocked
public boolean isAccountNonLocked()not used- Specified by:
isAccountNonLockedin interfaceorg.springframework.security.core.userdetails.UserDetails- Returns:
- true if the account is not locked
-
isCredentialsNonExpired
public boolean isCredentialsNonExpired()not used- Specified by:
isCredentialsNonExpiredin interfaceorg.springframework.security.core.userdetails.UserDetails- Returns:
- true if the credentials are not expired
-
isEnabled
public boolean isEnabled()used in authentication- Specified by:
isEnabledin interfaceorg.springframework.security.core.userdetails.UserDetails- Returns:
- true if the user is enabled
-
equals
-
hashCode
public int hashCode()
-