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