@Entity public class UserAccount extends AbstractEntity<UserAccountIdentifier>
Modifier and Type | Method and Description |
---|---|
boolean |
addRole(Role role)
Adds a
Role to a User |
java.lang.String |
getEmail() |
java.lang.String |
getFirstname() |
UserAccountIdentifier |
getIdentifier()
Get the unique identifier of this
User . |
java.lang.String |
getLastname() |
Password |
getPassword() |
java.lang.Iterable<Role> |
getRoles() |
boolean |
hasRole(Role role)
Checks if a
User has a specific Role |
boolean |
isEnabled() |
boolean |
removeRole(Role role)
Removes a
Role from a User . |
void |
setEmail(java.lang.String email) |
void |
setFirstname(java.lang.String firstname) |
void |
setLastname(java.lang.String lastname) |
equals, hashCode
public final UserAccountIdentifier getIdentifier()
User
.getIdentifier
in class AbstractEntity<UserAccountIdentifier>
UserAccountIdentifier
of this UserAccount
public boolean addRole(Role role)
Role
to a User
role
- role
which the user
will
receive.java.lang.NullPointerException
- if role is nullpublic boolean removeRole(Role role)
Role
from a User
.role
- role
which will be removed from
user
java.lang.NullPointerException
- if role is nullpublic boolean hasRole(Role role)
User
has a specific Role
role
- Role
for which the user
will be checked for.role
was granted to
user
java.lang.NullPointerException
- if role is nullpublic java.lang.Iterable<Role> getRoles()
Iterable/code> with all Role
s of the user
public Password getPassword()
public boolean isEnabled()
public java.lang.String getFirstname()
public void setFirstname(java.lang.String firstname)
public java.lang.String getLastname()
public void setLastname(java.lang.String lastname)
public java.lang.String getEmail()
public void setEmail(java.lang.String email)