src/main/java/seedu/address/logic/commands/commandEdit/EditStudentCommand.java
private static Student createEditedStudent(Student studentToEdit,
                                               EditStudentDescriptor editStudentDescriptor) {
        assert studentToEdit != null;

        Name updatedName = editStudentDescriptor.getName().orElse(studentToEdit.getName());
        Set<Tag> updatedTags = editStudentDescriptor.getTags().orElse(studentToEdit.getTags());
        Gender updatedGender = editStudentDescriptor.getGender().orElse(studentToEdit.getGender());
        // fields that cannot edit
        ID id = studentToEdit.getId();
        Set<ID> assignedCoursesID = studentToEdit.getAssignedCoursesID();
        return new Student(updatedName, id, updatedGender, assignedCoursesID, updatedTags);
    }
/**
     * Creates and returns a {@code Student} with the details of {@code studentToEdit} edited with
     * {@code editStudentDescriptor}.
     */
Creates and returns a  Student with the details of  studentToEdit edited with
editStudentDescriptor.
Creates and returns a Student with the details of studentToEdit edited with editStudentDescriptor .
private static Student createEditedStudent(Student studentToEdit,
                                               EditStudentDescriptor editStudentDescriptor) {
        assert studentToEdit != null;
        Name updatedName = editStudentDescriptor.getName().orElse(studentToEdit.getName());
        Set<Tag> updatedTags = editStudentDescriptor.getTags().orElse(studentToEdit.getTags());
        Gender updatedGender = editStudentDescriptor.getGender().orElse(studentToEdit.getGender());
        ID id = studentToEdit.getId();
        Set<ID> assignedCoursesID = studentToEdit.getAssignedCoursesID();
        return new Student(updatedName, id, updatedGender, assignedCoursesID, updatedTags);
    }
private static Student createEditedStudent ( Student studentToEdit , EditStudentDescriptor editStudentDescriptor ) { assert studentToEdit != null ; Name updatedName = editStudentDescriptor . getName ( ) . orElse ( studentToEdit . getName ( ) ) ; Set < Tag > updatedTags = editStudentDescriptor . getTags ( ) . orElse ( studentToEdit . getTags ( ) ) ; Gender updatedGender = editStudentDescriptor . getGender ( ) . orElse ( studentToEdit . getGender ( ) ) ; ID id = studentToEdit . getId ( ) ; Set < ID > assignedCoursesID = studentToEdit . getAssignedCoursesID ( ) ; return new Student ( updatedName , id , updatedGender , assignedCoursesID , updatedTags ) ; }
Creates and returns a {@code Student} with the details of {@code studentToEdit} edited with
 {@code editStudentDescriptor}.
Creates and returns a { @code Student } with the details of { @code studentToEdit } edited with { @code editStudentDescriptor } .
// fields that cannot edit