Package src.controller
Class UserManager
Object
UserManager
Controller class for handling all the logic related to all users
- Version:
- 1.0
- Author:
- Jonathan Ng
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
checkUniqueUser
(String username) Method to check database if the entered username is uniquestatic Object
Method to perform simple login by verifying the user's username and password entered according to the databasestatic MovieGoer
register
(MovieGoerAge age, String name, String username, String password, String email, String mobileNum) Method to register for a new movie goer account by creating aMovieGoer
object
-
Constructor Details
-
UserManager
public UserManager()Constructor
-
-
Method Details
-
login
Method to perform simple login by verifying the user's username and password entered according to the database- Parameters:
username
- is the username of the userpassword
- is the password of the user- Returns:
- An
CinemaStaff
orMovieGoer
Object based on which database the details was verified from
-
checkUniqueUser
Method to check database if the entered username is unique- Parameters:
username
- is the username entered by movie goer- Returns:
- A boolean flag whether the username is unique or not
-
register
public static MovieGoer register(MovieGoerAge age, String name, String username, String password, String email, String mobileNum) Method to register for a new movie goer account by creating aMovieGoer
object- Parameters:
age
- is theMovieGoerAge
of the movie goername
- is the name of the movie goerusername
- is the username of the movie goer's accountpassword
- is the password of the movie goer's accountemail
- is the email of the movie goermobileNum
- is the password of the movie goer- Returns:
- The created {MovieGoer} object
-