@Entity public class UserAccount extends AbstractEntity<UserAccountIdentifier>
Constructor and Description |
---|
UserAccount() |
UserAccount(UserAccountIdentifier userAccountIdentifier,
String password,
Role... roles) |
UserAccount(UserAccountIdentifier userAccountIdentifier,
String password,
String firstname,
String lastname,
String email,
Collection<Role> roles) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(Role role)
Adds a
Role to the UserAccount . |
String |
getEmail() |
String |
getFirstname() |
UserAccountIdentifier |
getId()
Get the unique identifier of this
UserAccount . |
String |
getLastname() |
Password |
getPassword() |
Streamable<Role> |
getRoles() |
String |
getUsername()
Returns the user's username.
|
boolean |
hasRole(Role role)
Checks if a
UserAccount has a specific Role |
boolean |
isEnabled() |
boolean |
remove(Role role)
Removes a
Role from a UserAccount . |
void |
setEmail(String email) |
void |
setEnabled(boolean enabled) |
void |
setFirstname(String firstname) |
void |
setLastname(String lastname) |
(package private) void |
setPassword(Password password) |
equals, hashCode, isNew
UserAccount(UserAccountIdentifier userAccountIdentifier, String password, Role... roles)
UserAccount(UserAccountIdentifier userAccountIdentifier, String password, String firstname, String lastname, String email, Collection<Role> roles)
@Generated(value="lombok") public UserAccount()
public UserAccountIdentifier getId()
UserAccount
.UserAccountIdentifier
of this UserAccount
public String getUsername()
public boolean add(Role role)
Role
to the UserAccount
.role
- role
which the user
will receive, must not be null.public boolean remove(Role role)
Role
from a UserAccount
.role
- role
which will be removed from user
, must not be null.public boolean hasRole(Role role)
UserAccount
has a specific Role
role
- Role
for which the user
will be checked for, must not be null.role
was granted to user
public Streamable<Role> getRoles()
Iterable/code> with all Role
s of the user
@Generated(value="lombok") public Password getPassword()
@Generated(value="lombok") void setPassword(Password password)
@Generated(value="lombok") public String getFirstname()
@Generated(value="lombok") public void setFirstname(String firstname)
@Generated(value="lombok") public String getLastname()
@Generated(value="lombok") public void setLastname(String lastname)
@Generated(value="lombok") public String getEmail()
@Generated(value="lombok") public void setEmail(String email)
@Generated(value="lombok") public boolean isEnabled()
@Generated(value="lombok") public void setEnabled(boolean enabled)
Copyright © 2018 Pivotal Software, Inc.. All rights reserved.