Package Controllers
Class AccountManager
java.lang.Object
Controllers.AccountManager
The
AccountManager
class provides functionalities for managing
user account details, including changing passwords, emails, and phone numbers.-
Constructor Summary
ConstructorsConstructorDescriptionAccountManager
(Account account, AccountDatabase accountDatabase, MedicalRecordDatabase medicalRecordDatabase) Constructs anAccountManager
with the specified account and databases. -
Method Summary
Modifier and TypeMethodDescriptionboolean
changeEmail
(String newEmail) Changes the email address associated with the user's medical record.boolean
changePassword
(String newPassword) Changes the password of the associated account.boolean
changePhone
(String newPhone) Changes the phone number associated with the user's medical record.
-
Constructor Details
-
AccountManager
public AccountManager(Account account, AccountDatabase accountDatabase, MedicalRecordDatabase medicalRecordDatabase) Constructs anAccountManager
with the specified account and databases.- Parameters:
account
- theAccount
associated with this manageraccountDatabase
- theAccountDatabase
for managing accountsmedicalRecordDatabase
- theMedicalRecordDatabase
for managing medical records
-
-
Method Details
-
changePassword
Changes the password of the associated account.- Parameters:
newPassword
- the new password to set for the account- Returns:
- true if the password was successfully changed; false if the new password is invalid
-
changeEmail
Changes the email address associated with the user's medical record.- Parameters:
newEmail
- the new email address to set- Returns:
- true if the email was successfully changed; false if the new email is invalid or medical record not found
-
changePhone
Changes the phone number associated with the user's medical record.- Parameters:
newPhone
- the new phone number to set- Returns:
- true if the phone number was successfully changed; false if the new phone number is invalid or medical record not found
-