Class UserSettingsControllerBuilder
java.lang.Object
ai.tutor.cab302exceptionalhandlers.builders.ControllerBuilder<UserSettingsController>
ai.tutor.cab302exceptionalhandlers.builders.UserSettingsControllerBuilder
Builder for creating instances of
UserSettingsController
.
This class is responsible for the construction of UserSettingsController
objects,
requiring the current authenticated User
.
Usage Example:
UserSettingsController controller = controllerFactory.userSettingsController() .currentUser(authenticatedUser) .build();
- Author:
- Justin.
- See Also:
-
Field Summary
Fields inherited from class ai.tutor.cab302exceptionalhandlers.builders.ControllerBuilder
db
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs aUserSettingsControllerBuilder
. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds aUserSettingsController
.currentUser
(User user) Sets the current authenticated user for theUserSettingsController
.
-
Constructor Details
-
UserSettingsControllerBuilder
Constructs aUserSettingsControllerBuilder
.- Parameters:
db
- TheSQLiteConnection
to be used for database operations.
-
-
Method Details
-
currentUser
Sets the current authenticated user for theUserSettingsController
.- Parameters:
user
- The authenticatedUser
.- Returns:
- This
UserSettingsControllerBuilder
instance for chaining.
-
build
Builds aUserSettingsController
.- Specified by:
build
in classControllerBuilder<UserSettingsController>
- Returns:
- A new instance of
UserSettingsController
. - Throws:
IllegalStateException
- if the current user is not set.RuntimeException
- if a database connection error occurs during controller construction.SQLException
- if a database access error occurs during controller construction.
-