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