Class UserAccount
- java.lang.Object
-
- org.salespointframework.core.AbstractEntity<UserAccountIdentifier>
-
- org.salespointframework.useraccount.UserAccount
-
- All Implemented Interfaces:
org.springframework.data.domain.Persistable<UserAccountIdentifier>
@Entity public class UserAccount extends AbstractEntity<UserAccountIdentifier>
Domain class for a user.- Author:
- Oliver Gierke, Paul Henke
-
-
Constructor Summary
Constructors Constructor Description UserAccount()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(Role role)Adds aRoleto theUserAccount.StringgetEmail()StringgetFirstname()UserAccountIdentifiergetId()Get the unique identifier of thisUserAccount.StringgetLastname()Password.EncryptedPasswordgetPassword()org.springframework.data.util.Streamable<Role>getRoles()StringgetUsername()Returns the user's username.booleanhasRole(Role role)Checks if aUserAccounthas a specificRolebooleanisEnabled()booleanremove(Role role)Removes aRolefrom aUserAccount.voidsetEmail(String email)voidsetEnabled(boolean enabled)voidsetFirstname(String firstname)voidsetLastname(String lastname)StringtoString()-
Methods inherited from class org.salespointframework.core.AbstractEntity
equals, hashCode, isNew
-
-
-
-
Method Detail
-
getId
public UserAccountIdentifier getId()
Get the unique identifier of thisUserAccount.- Returns:
- the
UserAccountIdentifierof thisUserAccount
-
getUsername
public String getUsername()
Returns the user's username.- Returns:
- will never be null.
-
add
public boolean add(Role role)
Adds aRoleto theUserAccount.- Parameters:
role-rolewhich theuserwill receive, must not be null.- Returns:
- true if successful, false otherwise.
-
remove
public boolean remove(Role role)
Removes aRolefrom aUserAccount.- Parameters:
role-rolewhich will be removed fromuser, must not be null.- Returns:
- true if successful, false otherwise.
-
hasRole
public boolean hasRole(Role role)
Checks if aUserAccounthas a specificRole- Parameters:
role-Rolefor which theuserwill be checked for, must not be null.- Returns:
- true if
rolewas granted touser
-
getRoles
public org.springframework.data.util.Streamable<Role> getRoles()
- Returns:
- A
Streamable/code> with allRoles of the user
-
getPassword
public Password.EncryptedPassword getPassword()
-
getFirstname
public String getFirstname()
-
setFirstname
public void setFirstname(String firstname)
-
getLastname
public String getLastname()
-
setLastname
public void setLastname(String lastname)
-
getEmail
public String getEmail()
-
setEmail
public void setEmail(String email)
-
isEnabled
public boolean isEnabled()
-
setEnabled
public void setEnabled(boolean enabled)
-
-