src/main/java/seedu/address/logic/commands/EditCommand.java
/**
     * Creates and returns a {@code StudySpot} with the details of {@code studySpotToEdit}
     * edited with {@code editStudySpotDescriptor}.
     */
Creates and returns a  StudySpot with the details of  studySpotToEdit
edited with  editStudySpotDescriptor.
Creates and returns a StudySpot with the details of studySpotToEdit edited with editStudySpotDescriptor .
private static StudySpot createEditedStudySpot(StudySpot studySpotToEdit,
                                                   EditStudySpotDescriptor editStudySpotDescriptor)
            throws CommandException {
        assert studySpotToEdit != null;
        Name updatedName = editStudySpotDescriptor.getName().orElse(studySpotToEdit.getName());
        Rating updatedRating = editStudySpotDescriptor.getRating().orElse(studySpotToEdit.getRating());
        OperatingHours updatedOperatingHours = editStudySpotDescriptor.getOperatingHours()
                .orElse(studySpotToEdit.getOperatingHours());
        Address updatedAddress = editStudySpotDescriptor.getAddress().orElse(studySpotToEdit.getAddress());
        StudiedHours studiedHours = studySpotToEdit.getStudiedHours();
        Set<Tag> updatedTags = editStudySpotDescriptor.updateTags(studySpotToEdit.getTags())
                .getTags().orElse(studySpotToEdit.getTags());
        Set<Amenity> updatedAmenities = editStudySpotDescriptor.updateAmenities(studySpotToEdit.getAmenities())
                .getAmenities().orElse(studySpotToEdit.getAmenities());
        Favourite updatedFavourite = editStudySpotDescriptor.getFavourite().orElse(studySpotToEdit.getFavourite());
        return new StudySpot(updatedName, updatedRating, updatedOperatingHours, updatedAddress, studiedHours,
                updatedFavourite, updatedTags, updatedAmenities);
    }
private static StudySpot createEditedStudySpot ( StudySpot studySpotToEdit , EditStudySpotDescriptor editStudySpotDescriptor ) throws CommandException { assert studySpotToEdit != null ; Name updatedName = editStudySpotDescriptor . getName ( ) . orElse ( studySpotToEdit . getName ( ) ) ; Rating updatedRating = editStudySpotDescriptor . getRating ( ) . orElse ( studySpotToEdit . getRating ( ) ) ; OperatingHours updatedOperatingHours = editStudySpotDescriptor . getOperatingHours ( ) . orElse ( studySpotToEdit . getOperatingHours ( ) ) ; Address updatedAddress = editStudySpotDescriptor . getAddress ( ) . orElse ( studySpotToEdit . getAddress ( ) ) ; StudiedHours studiedHours = studySpotToEdit . getStudiedHours ( ) ; Set < Tag > updatedTags = editStudySpotDescriptor . updateTags ( studySpotToEdit . getTags ( ) ) . getTags ( ) . orElse ( studySpotToEdit . getTags ( ) ) ; Set < Amenity > updatedAmenities = editStudySpotDescriptor . updateAmenities ( studySpotToEdit . getAmenities ( ) ) . getAmenities ( ) . orElse ( studySpotToEdit . getAmenities ( ) ) ; Favourite updatedFavourite = editStudySpotDescriptor . getFavourite ( ) . orElse ( studySpotToEdit . getFavourite ( ) ) ; return new StudySpot ( updatedName , updatedRating , updatedOperatingHours , updatedAddress , studiedHours , updatedFavourite , updatedTags , updatedAmenities ) ; }
Creates and returns a {@code StudySpot} with the details of {@code studySpotToEdit}
 edited with {@code editStudySpotDescriptor}.
Creates and returns a { @code StudySpot } with the details of { @code studySpotToEdit } edited with { @code editStudySpotDescriptor } .
//Studied hours should not be changeable via Edit, so return same value