src/main/java/seedu/address/logic/commands/commandEdit/EditCourseCommand.java
private static Course createEditedCourse(Course courseToEdit,
                                             EditCourseDescriptor editCourseDescriptor) {
        assert courseToEdit != null;

        Name updatedName = editCourseDescriptor.getName().orElse(courseToEdit.getName());
        Amount updatedAmount = editCourseDescriptor.getAmount().orElse(courseToEdit.getAmount());
        Set<Tag> updatedTags = editCourseDescriptor.getTags().orElse(courseToEdit.getTags());

        // fields that cannot edit
        ID courseID = courseToEdit.getId();
        ID assignedStaffID = courseToEdit.getAssignedStaffID();
        Set<ID> assignedAssignmentsID = courseToEdit.getAssignedAssignmentsID();
        Set<ID> assignedStudentsID = courseToEdit.getAssignedStudentsID();
        return new Course(updatedName, courseID, updatedAmount,
                assignedStaffID, assignedStudentsID, assignedAssignmentsID, updatedTags);
    }
/**
     * Creates and returns a {@code Assignment} with the details of {@code courseToEdit} edited with
     * {@code editCourseDescriptor}.
     */
Creates and returns a  Assignment with the details of  courseToEdit edited with
editCourseDescriptor.
Creates and returns a Assignment with the details of courseToEdit edited with editCourseDescriptor .
private static Course createEditedCourse(Course courseToEdit,
                                             EditCourseDescriptor editCourseDescriptor) {
        assert courseToEdit != null;
        Name updatedName = editCourseDescriptor.getName().orElse(courseToEdit.getName());
        Amount updatedAmount = editCourseDescriptor.getAmount().orElse(courseToEdit.getAmount());
        Set<Tag> updatedTags = editCourseDescriptor.getTags().orElse(courseToEdit.getTags());
        ID courseID = courseToEdit.getId();
        ID assignedStaffID = courseToEdit.getAssignedStaffID();
        Set<ID> assignedAssignmentsID = courseToEdit.getAssignedAssignmentsID();
        Set<ID> assignedStudentsID = courseToEdit.getAssignedStudentsID();
        return new Course(updatedName, courseID, updatedAmount,
                assignedStaffID, assignedStudentsID, assignedAssignmentsID, updatedTags);
    }
private static Course createEditedCourse ( Course courseToEdit , EditCourseDescriptor editCourseDescriptor ) { assert courseToEdit != null ; Name updatedName = editCourseDescriptor . getName ( ) . orElse ( courseToEdit . getName ( ) ) ; Amount updatedAmount = editCourseDescriptor . getAmount ( ) . orElse ( courseToEdit . getAmount ( ) ) ; Set < Tag > updatedTags = editCourseDescriptor . getTags ( ) . orElse ( courseToEdit . getTags ( ) ) ; ID courseID = courseToEdit . getId ( ) ; ID assignedStaffID = courseToEdit . getAssignedStaffID ( ) ; Set < ID > assignedAssignmentsID = courseToEdit . getAssignedAssignmentsID ( ) ; Set < ID > assignedStudentsID = courseToEdit . getAssignedStudentsID ( ) ; return new Course ( updatedName , courseID , updatedAmount , assignedStaffID , assignedStudentsID , assignedAssignmentsID , updatedTags ) ; }
Creates and returns a {@code Assignment} with the details of {@code courseToEdit} edited with
 {@code editCourseDescriptor}.
Creates and returns a { @code Assignment } with the details of { @code courseToEdit } edited with { @code editCourseDescriptor } .
// fields that cannot edit