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 class
UserAccount.UserAccountCreated
-
Method Summary
Modifier and Type Method Description boolean
add(Role role)
Adds aRole
to theUserAccount
.String
getEmail()
String
getFirstname()
UserAccountIdentifier
getId()
Get the unique identifier of thisUserAccount
.String
getLastname()
Password.EncryptedPassword
getPassword()
Streamable<Role>
getRoles()
String
getUsername()
Returns the user's username.boolean
hasRole(Role role)
Checks if aUserAccount
has a specificRole
boolean
isEnabled()
boolean
remove(Role role)
Removes aRole
from aUserAccount
.UserAccount
setEmail(String email)
UserAccount
setEnabled(boolean enabled)
UserAccount
setFirstname(String firstname)
UserAccount
setLastname(String lastname)
String
toString()
Methods inherited from class org.salespointframework.core.AbstractEntity
equals, hashCode, hasId, isNew
-
Method Details
-
getId
Get the unique identifier of thisUserAccount
.- Returns:
- the
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
-
getLastname
-
setLastname
-
getEmail
-
setEmail
-
isEnabled
public boolean isEnabled() -
setEnabled
-