Class UserAccount
java.lang.Object
org.salespointframework.core.AbstractEntity<ID>
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
Modifier and TypeClassDescriptionstatic final class
static class
UserAccount.UserAccountIdentifier
serves as an identifier type forUserAccount
objects. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Adds aRole
to theUserAccount
.getEmail()
getId()
Returns the unique identifier of thisUserAccount
.getRoles()
boolean
Checks if aUserAccount
has a specificRole
boolean
boolean
Removes aRole
from aUserAccount
.setEnabled
(boolean enabled) setFirstname
(String firstname) setLastname
(String lastname) setUsername
(String username) toString()
Methods inherited from class org.salespointframework.core.AbstractAggregateRoot
registerEvent
Methods 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 aRole
to theUserAccount
.- Parameters:
role
-role
which theuser
will receive, must not be null.- Returns:
- true if successful, false otherwise.
-
remove
Removes aRole
from aUserAccount
.- Parameters:
role
-role
which will be removed fromuser
, must not be null.- Returns:
- true if successful, false otherwise.
-
hasRole
Checks if aUserAccount
has a specificRole
- Parameters:
role
-Role
for which theuser
will be checked for, must not be null.- Returns:
- true if
role
was granted touser
-
getRoles
- Returns:
- A
Streamable
with allRole
s 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
.
-