- java.lang.Object
-
- model.user.User
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
email
Variable to check for first loginprivate Schools
faculty
Faculty information.private boolean
firstLogin
Boolean to check if it is user's first loginprivate java.lang.String
name
Name of user.private java.lang.String
password
Password of the user.private UserRole
type
UserRole
of the user.private java.lang.String
userID
Unique NTU ID of the user.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getEmail()
Gets the email of the userSchools
getFaculty()
Gets the user's faculty infojava.lang.String
getID()
Gets the user's IDjava.lang.String
getName()
Gets the user's namejava.lang.String
getPassword()
Gets the user's passwordUserRole
getType()
Gets the user's roleboolean
isFirstLogin()
Check's if it's user's first loginvoid
removeDefault()
Change firstLogin boolean to false after removing the default passwordboolean
setPassword(java.lang.String newPassword)
Set passwordvoid
setType(UserRole type)
Sets the usertype
-
-
-
Field Detail
-
userID
private java.lang.String userID
Unique NTU ID of the user.
-
password
private java.lang.String password
Password of the user.
-
faculty
private Schools faculty
Faculty information.
-
name
private java.lang.String name
Name of user.
-
email
private java.lang.String email
Variable to check for first login
-
firstLogin
private boolean firstLogin
Boolean to check if it is user's first login
-
-
Constructor Detail
-
User
public User(java.lang.String name, java.lang.String password, java.lang.String userID, java.lang.String email, Schools faculty, UserRole type, boolean firstLogin)
Create an object of theUser
class- Parameters:
name
- user's namepassword
- user's passworduserID
- user's IDemail
- user's emailfaculty
- user's faculty infotype
- user's rolefirstLogin
- Check if it's user's first login
-
-
Method Detail
-
getName
public java.lang.String getName()
Gets the user's name- Returns:
- name
-
getID
public java.lang.String getID()
Gets the user's ID- Returns:
- userID
-
getPassword
public java.lang.String getPassword()
Gets the user's password- Returns:
- password
-
setPassword
public boolean setPassword(java.lang.String newPassword)
Set password- Parameters:
newPassword
- The new password set by the user- Returns:
- boolean that show password set success
-
getEmail
public java.lang.String getEmail()
Gets the email of the user- Returns:
- the email
-
getFaculty
public Schools getFaculty()
Gets the user's faculty info- Returns:
- faculty
-
getType
public UserRole getType()
Gets the user's role- Returns:
- type of user's role
-
setType
public void setType(UserRole type)
Sets the usertype- Parameters:
type
- the type to set
-
isFirstLogin
public boolean isFirstLogin()
Check's if it's user's first login- Returns:
- firstLogin
-
removeDefault
public void removeDefault()
Change firstLogin boolean to false after removing the default password
-
-