- java.lang.Object
-
- services.CampStaffService
-
- All Implemented Interfaces:
ICampStaffService
public class CampStaffService extends java.lang.Object implements ICampStaffService
CampStaffService
implementsICampStaffService
interface 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 boolean
createCamp(Camp camp)
Creates camps based on the provided list.boolean
deleteCamp(Camp camp)
Deletes a camp.boolean
editCamp(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 userboolean
toggleCampVisibilty(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:ICampStaffService
Creates camps based on the provided list.- Specified by:
createCamp
in interfaceICampStaffService
- Parameters:
camp
- The list of camps that exists already.- Returns:
true
if the camps are created successfully,false
otherwise.
-
getAllCamps
public java.util.ArrayList<Camp> getAllCamps()
Description copied from interface:ICampStaffService
Retrieves all camps.- Specified by:
getAllCamps
in interfaceICampStaffService
- Returns:
- An
ArrayList
ofCamp
containing 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:
getCreatedCamps
in 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:ICampStaffService
Edits a specific field (such as date, description ...) of a camp.- Specified by:
editCamp
in interfaceICampStaffService
- Parameters:
camp
- The camp to be edited.field
- The field index to be edited.value
- The new value for the field.- Returns:
true
if the camp is edited successfully,false
otherwise.
-
deleteCamp
public boolean deleteCamp(Camp camp)
Description copied from interface:ICampStaffService
Deletes a camp.- Specified by:
deleteCamp
in interfaceICampStaffService
- Parameters:
camp
- The camp to be deleted.- Returns:
true
if the camp is deleted successfully,false
otherwise.
-
toggleCampVisibilty
public boolean toggleCampVisibilty(java.util.ArrayList<Camp> camps)
Description copied from interface:ICampStaffService
Toggles the visibility of the provided list of camps.- Specified by:
toggleCampVisibilty
in interfaceICampStaffService
- Parameters:
camps
- TheArrayList
ofCamp
s for which visibility will be toggled.- Returns:
true
if the visibility is toggled successfully,false
otherwise.
-
-