- java.lang.Object
-
- services.CampStaffService
-
- All Implemented Interfaces:
ICampStaffService
public class CampStaffService extends java.lang.Object implements ICampStaffService
CampStaffServiceimplementsICampStaffServiceinterface and provide camp functions in the role permission of a staff
-
-
Constructor Summary
Constructors Constructor Description CampStaffService()Construct an instance ofCampStaffService
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancreateCamp(Camp camp)Creates camps based on the provided list.booleandeleteCamp(Camp camp)Deletes a camp.booleaneditCamp(Camp camp, int field, java.lang.Object value)Edits a specific field (such as date, description ...) of a camp.java.util.ArrayList<Camp>getAllCamps()Retrieves all camps.java.util.ArrayList<Camp>getCreatedCamps()Check who the logged in staff user is and get all the camps created by this staff userbooleantoggleCampVisibilty(java.util.ArrayList<Camp> camps)Toggles the visibility of the provided list of camps.
-
-
-
Constructor Detail
-
CampStaffService
public CampStaffService()
Construct an instance ofCampStaffService
-
-
Method Detail
-
createCamp
public boolean createCamp(Camp camp)
Description copied from interface:ICampStaffServiceCreates camps based on the provided list.- Specified by:
createCampin interfaceICampStaffService- Parameters:
camp- The list of camps that exists already.- Returns:
trueif the camps are created successfully,falseotherwise.
-
getAllCamps
public java.util.ArrayList<Camp> getAllCamps()
Description copied from interface:ICampStaffServiceRetrieves all camps.- Specified by:
getAllCampsin interfaceICampStaffService- Returns:
- An
ArrayListofCampcontaining all camps.
-
getCreatedCamps
public java.util.ArrayList<Camp> getCreatedCamps()
Check who the logged in staff user is and get all the camps created by this staff user- Specified by:
getCreatedCampsin interfaceICampStaffService- Returns:
- an ArrayList of camps created by the logged in staff user
-
editCamp
public boolean editCamp(Camp camp, int field, java.lang.Object value)
Description copied from interface:ICampStaffServiceEdits a specific field (such as date, description ...) of a camp.- Specified by:
editCampin interfaceICampStaffService- Parameters:
camp- The camp to be edited.field- The field index to be edited.value- The new value for the field.- Returns:
trueif the camp is edited successfully,falseotherwise.
-
deleteCamp
public boolean deleteCamp(Camp camp)
Description copied from interface:ICampStaffServiceDeletes a camp.- Specified by:
deleteCampin interfaceICampStaffService- Parameters:
camp- The camp to be deleted.- Returns:
trueif the camp is deleted successfully,falseotherwise.
-
toggleCampVisibilty
public boolean toggleCampVisibilty(java.util.ArrayList<Camp> camps)
Description copied from interface:ICampStaffServiceToggles the visibility of the provided list of camps.- Specified by:
toggleCampVisibiltyin interfaceICampStaffService- Parameters:
camps- TheArrayListofCamps for which visibility will be toggled.- Returns:
trueif the visibility is toggled successfully,falseotherwise.
-
-