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
Nested ClassesModifier 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()
Get the unique identifier of thisUserAccount
.getRoles()
Returns the user's username.boolean
Checks if aUserAccount
has a specificRole
boolean
boolean
Removes aRole
from aUserAccount
.setEnabled
(boolean enabled) setFirstname
(String firstname) setLastname
(String lastname) 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
Get the unique identifier of thisUserAccount
.- Returns:
- the
UserAccount.UserAccountIdentifier
of thisUserAccount
-
getUsername
Returns the user's username.- 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/code> with all
Role
s of the user
-
toString
-
getPassword
-
getFirstname
-
setFirstname
- Returns:
this
.
-
getLastname
-
setLastname
- Returns:
this
.
-
getEmail
-
setEmail
- Returns:
this
.
-
isEnabled
public boolean isEnabled() -
setEnabled
- Returns:
this
.
-