@Entity(name="User") public class User extends Object implements Serializable
| Modifier | Constructor and Description |
|---|---|
protected |
User() |
|
User(Long id,
String username,
String password,
UserType role,
Collection<Story> stories) |
|
User(String username,
String password,
UserType role) |
|
User(String username,
String password,
UserType role,
Collection<Story> stories) |
| Modifier and Type | Method and Description |
|---|---|
void |
addFavoriteStory(Story story) |
void |
addStory(Story story) |
void |
changePassword(String password)
Changes the password of the user.
|
Set<Story> |
getFavoriteStories() |
Long |
getId() |
String |
getPassword()
Returns the MD5 of the user's password.
|
UserType |
getRole() |
Set<Story> |
getStories() |
String |
getUsername() |
void |
removeFavoriteStory(Story story) |
void |
setId(Long id) |
void |
setPassword(String password)
Sets the MD5 password of the user.
|
void |
setRole(UserType role) |
protected void |
setStories(Set<Story> stories) |
void |
setUsername(String username) |
protected User()
public User(String username, String password, UserType role, Collection<Story> stories)
public Long getId()
public void setId(Long id)
public String getUsername()
public void setUsername(String username)
public String getPassword()
public void setPassword(String password)
password - the MD5 password of the user. This parameter must be a
non null MD5 string.NullPointerException - if null is passed as parameter.IllegalArgumentException - if the string passed is not a valid MD5
string.public void changePassword(String password)
password - the raw password of the user. This parameter must be a
non null string with a minimum length of 8 chars and maximum
length of 32 chars.NullPointerException - if the password is null.IllegalArgumentException - if the length of the string passed is
not valid.public UserType getRole()
public void setRole(UserType role)
public void addStory(Story story)
public void addFavoriteStory(Story story)
public void removeFavoriteStory(Story story)
Copyright © 2025. All rights reserved.