public class User extends Object implements Serializable, Comparable
UserAdministration
interface.Modifier and Type | Field and Description |
---|---|
static String |
NAME_PARAM |
static String |
QUERY_ALL_USERS |
static String |
QUERY_COUNT_USERS |
static String |
QUERY_FIND_BY_GROUP_NAME |
static String |
QUERY_FIND_BY_NAME |
Constructor and Description |
---|
User(User aUser)
Creates a new User object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
changePassword(String aOldPassword,
String aNewPassword)
Changes the password.
|
boolean |
checkPassword(String aPassword)
Checks the password.
|
int |
compareTo(Object aUser) |
boolean |
equals(Object aUser) |
Set<Group> |
getGroups()
Gets the groups the user belongs to.
|
String |
getName() |
protected String |
getPasswordString()
For OR mapping.
|
Long |
getPrimaryKey() |
int |
hashCode() |
boolean |
isInGroup(Group aGroup)
Checks whether the user belongs to the given group.
|
boolean |
isInGroup(String aGroup)
Checks whether the user belongs to the given group.
|
void |
setPassword(String aPassword) |
void |
setPasswordEncoder(MessageDigester aPasswordEncoder)
Sets the password encoder.
|
protected void |
setPasswordString(String aPassword)
For OR mapping.
|
void |
setPasswordValidator(NameValidator aPasswordValidator)
Sets the password validator.
|
String |
toString() |
public static final String QUERY_FIND_BY_NAME
public static final String QUERY_FIND_BY_GROUP_NAME
public static final String QUERY_COUNT_USERS
public static final String QUERY_ALL_USERS
public static final String NAME_PARAM
public User(User aUser)
public void setPasswordValidator(NameValidator aPasswordValidator)
aPasswordValidator
- Validator.public void setPasswordEncoder(MessageDigester aPasswordEncoder)
aPasswordEncoder
- Encoder.public boolean checkPassword(String aPassword)
aPassword
- Password to check.public boolean changePassword(String aOldPassword, String aNewPassword)
aOldPassword
- Old password.aNewPassword
- New password.public void setPassword(String aPassword)
aPassword
- The password to set.protected String getPasswordString()
protected void setPasswordString(String aPassword)
aPassword
- Password.public String getName()
public boolean isInGroup(Group aGroup)
aGroup
- Group.public boolean isInGroup(String aGroup)
aGroup
- Group.public int compareTo(Object aUser)
compareTo
in interface Comparable
public Long getPrimaryKey()
Copyright © 2022. All rights reserved.