- * userid is autogenerated
- *
- * @param username The username (String) of the user
- * @param password The password (String) of the user
- * @param primaryemail The primary email (String) of the user
- */
public User(
String username,
String password,
@@ -93,101 +68,57 @@ public User(
this.comments = comments;
}
- /**
- * Getter for userid
- *
- * @return the userid (long) of the user
- */
public long getUserid()
{
return userid;
}
- /**
- * Setter for userid. Used primary for seeding data
- *
- * @param userid the new userid (long) of the user
- */
public void setUserid(long userid)
{
this.userid = userid;
}
- /**
- * Getter for username
- *
- * @return the username (String) lowercase
- */
public String getUsername()
{
return username;
}
- /**
- * setter for username
- *
- * @param username the new username (String) converted to lowercase
- */
public void setUsername(String username)
{
this.username = username.toLowerCase();
}
- /**
- * getter for primary email
- *
- * @return the primary email (String) for the user converted to lowercase
- */
public String getPrimaryemail()
{
return primaryemail;
}
- /**
- * setter for primary email
- *
- * @param primaryemail the new primary email (String) for the user converted to lowercase
- */
public void setPrimaryemail(String primaryemail)
{
this.primaryemail = primaryemail.toLowerCase();
}
- /**
- * Getter for the password
- *
- * @return the password (String) of the user
- */
public String getPassword()
{
return password;
}
- /**
- * Setter for password
- *
- * @param password the new password (String) for the user
- */
- public void setPassword(String password)
+ public void setPasswordNoEncrypt(String password)
{
this.password = password;
}
- /**
- * Getter for user role combinations
- *
- * @return A list of user role combinations associated with this user
- */
+ public void setPassword(String password)
+ {
+ BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
+ this.password = passwordEncoder.encode(password);
+ }
+
public Set