Package services

Class CampStaffService

    • 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 user
      boolean toggleCampVisibilty​(java.util.ArrayList<Camp> camps)
      Toggles the visibility of the provided list of camps.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CampStaffService

        public CampStaffService()
        Construct an instance of CampStaffService
    • Method Detail

      • createCamp

        public boolean createCamp​(Camp camp)
        Description copied from interface: ICampStaffService
        Creates camps based on the provided list.
        Specified by:
        createCamp in interface ICampStaffService
        Parameters:
        camp - The list of camps that exists already.
        Returns:
        true if the camps are created successfully, false otherwise.
      • 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 interface ICampStaffService
        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 interface ICampStaffService
        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 interface ICampStaffService
        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 interface ICampStaffService
        Parameters:
        camps - The ArrayList of Camps for which visibility will be toggled.
        Returns:
        true if the visibility is toggled successfully, false otherwise.