Class CampModificationController

java.lang.Object
app.controller.camp.CampModificationController

public class CampModificationController extends Object
The CampModificationController class is responsible for handling the creation, deletion, and editing of camp records in the camp repository. This class serves as a app.controller to manage camp data, leveraging the RepositoryCollection for data storage and retrieval operations.

Key functionalities include:

  • Creating new camp records and adding them to the repository.
  • Deleting existing camp records from the repository.
  • Editing and updating details of existing camp records.

This app.controller interacts with the RepositoryCollection to perform CRUD (Create, Read, Update, Delete) operations on camp data, ensuring data integrity and consistency across the application.

See Also:
  • Method Details

    • createCamp

      public static boolean createCamp(Camp camp)
      Creates a new camp by inserting it into the camp repository. This method adds the specified Camp object to the camp repository.
      Parameters:
      camp - The Camp object to be inserted.
    • deleteCamp

      public static boolean deleteCamp(Camp camp)
      Deletes a camp from the camp repository. This method removes the specified Camp object from the camp repository.
      Parameters:
      camp - The Camp object to be removed.
    • editCamp

      public static void editCamp(CampDetails newCD)
      Edits an existing camp in the camp repository by updating its details. This method fetches a camp by its ID and updates its properties based on the provided CampDetails object. Fields in the CampDetails object that are non-null are used to update the corresponding fields in the camp object. This includes the camp's description, start date, end date, registration closing date, name, school, and location.

      Note: If the CampDetails object contains a new ID, it updates the ID of the camp as well.

      Parameters:
      newCD - The CampDetails object containing the new details for the camp.