Class UserAccount
java.lang.Object
org.salespointframework.core.AbstractEntity<UserAccount.UserAccountIdentifier>
org.salespointframework.core.AbstractAggregateRoot<UserAccount.UserAccountIdentifier>
org.salespointframework.useraccount.UserAccount
- All Implemented Interfaces:
Persistable<UserAccount.UserAccountIdentifier>
A user account aggregate.
- Author:
- Oliver Gierke, Paul Henke
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic classUserAccount.UserAccountIdentifierserves as an identifier type forUserAccountobjects. -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds aRoleto theUserAccount.getEmail()getId()Returns the unique identifier of thisUserAccount.getRoles()booleanChecks if aUserAccounthas a specificRolebooleanbooleanRemoves aRolefrom aUserAccount.setEnabled(boolean enabled) setFirstname(String firstname) setLastname(String lastname) setUsername(String username) toString()Methods inherited from class org.salespointframework.core.AbstractAggregateRoot
registerEventMethods inherited from class org.salespointframework.core.AbstractEntity
equals, hashCode, hasId, isNew
-
Method Details
-
getId
Returns the unique identifier of thisUserAccount.- 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
Streamablewith allRoles of the user
-
toString
-
getPassword
-
getFirstname
-
getLastname
-
setFirstname
- Returns:
this.
-
setLastname
- Returns:
this.
-
getEmail
-
setEmail
- Returns:
this.
-
getUsername
-
setUsername
- Returns:
this.
-
isEnabled
public boolean isEnabled() -
setEnabled
- Returns:
this.
-