@Entity public class UserAccount extends AbstractEntity<UserAccountIdentifier>
Modifier | Constructor and Description |
---|---|
protected |
UserAccount()
Deprecated.
|
(package private) |
UserAccount(UserAccountIdentifier userAccountIdentifier,
String password,
Role... roles) |
(package private) |
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 |
getIdentifier()
Get the unique identifier of this
UserAccount . |
String |
getLastname() |
Password |
getPassword() |
Iterable<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) |
(package private) void |
setEnabled(boolean isEnabled) |
void |
setFirstname(String firstname) |
void |
setLastname(String lastname) |
(package private) void |
setPassword(Password password) |
equals, getId, hashCode, isNew
@Deprecated protected UserAccount()
UserAccount(UserAccountIdentifier userAccountIdentifier, String password, Role... roles)
UserAccount(UserAccountIdentifier userAccountIdentifier, String password, String firstname, String lastname, String email, Collection<Role> roles)
public final UserAccountIdentifier getIdentifier()
UserAccount
.getIdentifier
in class AbstractEntity<UserAccountIdentifier>
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 Password getPassword()
void setPassword(Password password)
public boolean isEnabled()
void setEnabled(boolean isEnabled)
public String getFirstname()
public void setFirstname(String firstname)
public String getLastname()
public void setLastname(String lastname)
public String getEmail()
public void setEmail(String email)
Copyright © 2014 Pivotal Software, Inc.. All rights reserved.