java.lang.Object
ai.tutor.cab302exceptionalhandlers.builders.ControllerBuilder<T>
Type Parameters:
T - The type of controller to be built.
Direct Known Subclasses:
AuthControllerBuilder, ChatControllerBuilder, ChatSetupControllerBuilder, QuizControllerBuilder, UserSettingsControllerBuilder

public abstract class ControllerBuilder<T> extends Object
Abstract base class for all controller builders.

This class provides a common structure for controller factories to dynamically create their respective controllers, ensuring each builder has access to a SQLiteConnection.

Author:
Justin.
  • Field Details

  • Constructor Details

    • ControllerBuilder

      public ControllerBuilder(SQLiteConnection db)
      Constructs a ControllerBuilder with the given database connection.
      Parameters:
      db - The SQLiteConnection to be used by the builder and the resulting controller.
  • Method Details

    • build

      public abstract T build() throws Exception
      Abstract method to build the controller.

      Subclasses must implement this method to return an instance of the controller of type <T>, configured with parameters set via the builder's methods.

      Returns:
      The built controller.
      Throws:
      Exception - if an error occurs during the controller construction process.