Package app.controller.camp
Class CampModificationController
java.lang.Object
app.controller.camp.CampModificationController
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 Summary
Modifier and TypeMethodDescriptionstatic booleancreateCamp(Camp camp) Creates a new camp by inserting it into the camp repository.static booleandeleteCamp(Camp camp) Deletes a camp from the camp repository.static voideditCamp(CampDetails newCD) Edits an existing camp in the camp repository by updating its details.
-
Method Details
-
createCamp
Creates a new camp by inserting it into the camp repository. This method adds the specifiedCampobject to the camp repository.- Parameters:
camp- TheCampobject to be inserted.
-
deleteCamp
Deletes a camp from the camp repository. This method removes the specifiedCampobject from the camp repository.- Parameters:
camp- TheCampobject to be removed.
-
editCamp
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 providedCampDetailsobject. Fields in theCampDetailsobject 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
CampDetailsobject contains a new ID, it updates the ID of the camp as well.- Parameters:
newCD- TheCampDetailsobject containing the new details for the camp.
-