- java.lang.Object
-
- model.user.User
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringemailVariable to check for first loginprivate SchoolsfacultyFaculty information.private booleanfirstLoginBoolean to check if it is user's first loginprivate java.lang.StringnameName of user.private java.lang.StringpasswordPassword of the user.private UserRoletypeUserRoleof the user.private java.lang.StringuserIDUnique NTU ID of the user.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetEmail()Gets the email of the userSchoolsgetFaculty()Gets the user's faculty infojava.lang.StringgetID()Gets the user's IDjava.lang.StringgetName()Gets the user's namejava.lang.StringgetPassword()Gets the user's passwordUserRolegetType()Gets the user's rolebooleanisFirstLogin()Check's if it's user's first loginvoidremoveDefault()Change firstLogin boolean to false after removing the default passwordbooleansetPassword(java.lang.String newPassword)Set passwordvoidsetType(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 theUserclass- 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
-
-