src/main/java/seedu/address/logic/commands/applicant/EditApplicant.java
private static Applicant createEditedApplicant(Applicant applicantToEdit,
                                                EditApplicantDescriptor editApplicantDescriptor)
                                                        throws CommandException {
        assert applicantToEdit != null;

        Name updatedName = editApplicantDescriptor.getName().orElse(applicantToEdit.getName());
        Phone updatedPhone = editApplicantDescriptor.getPhone().orElse(applicantToEdit.getPhone());
        Email updatedEmail = editApplicantDescriptor.getEmail().orElse(applicantToEdit.getEmail());
        Address updatedAddress = editApplicantDescriptor.getAddress().orElse(applicantToEdit.getAddress());
        Set<Tag> updatedTags = editApplicantDescriptor.getTags().orElse(applicantToEdit.getTags());

        DateApplied updatedDateApplied = editApplicantDescriptor.getDateApplied()
                .orElse(applicantToEdit.getDateApplied());
        Nric updatedNric = editApplicantDescriptor.getNric().orElse(applicantToEdit.getNric());
        Qualification updatedQualification = editApplicantDescriptor.getQualification()
                .orElse(applicantToEdit.getQualification());
        InterviewDate updatedInterviewDate = editApplicantDescriptor.getInterviewDate()
                .orElse(applicantToEdit.getInterviewDate());
        JobId updatedJob = editApplicantDescriptor.getJobId().orElse(applicantToEdit.getJobId());
        ApplicantStatus applicantStatus = applicantToEdit.getApplicantStatus();

        LocalDate dateApplied = updatedDateApplied.date;
        LocalDate interviewDate = updatedInterviewDate.date;
        if (interviewDate.compareTo(dateApplied) < 0 && updatedInterviewDate.isInit) {
            throw new CommandException(MESSAGE_DATE_APPLIED_LATER_THAN_INTERVIEW_DATE);
        }

        return new Applicant(updatedName, updatedPhone, updatedEmail, updatedAddress, updatedTags, updatedDateApplied,
                updatedNric, updatedJob, updatedInterviewDate, updatedQualification, applicantStatus);
    }
/**
     * Creates and returns a {@code Applicant} with the details of {@code applicantToEdit}
     * edited with {@code editApplicantDescriptor}.
     */
Creates and returns a  Applicant with the details of  applicantToEdit
edited with  editApplicantDescriptor.
Creates and returns a Applicant with the details of applicantToEdit edited with editApplicantDescriptor .
private static Applicant createEditedApplicant(Applicant applicantToEdit,
                                                EditApplicantDescriptor editApplicantDescriptor)
                                                        throws CommandException {
        assert applicantToEdit != null;
        Name updatedName = editApplicantDescriptor.getName().orElse(applicantToEdit.getName());
        Phone updatedPhone = editApplicantDescriptor.getPhone().orElse(applicantToEdit.getPhone());
        Email updatedEmail = editApplicantDescriptor.getEmail().orElse(applicantToEdit.getEmail());
        Address updatedAddress = editApplicantDescriptor.getAddress().orElse(applicantToEdit.getAddress());
        Set<Tag> updatedTags = editApplicantDescriptor.getTags().orElse(applicantToEdit.getTags());
        DateApplied updatedDateApplied = editApplicantDescriptor.getDateApplied()
                .orElse(applicantToEdit.getDateApplied());
        Nric updatedNric = editApplicantDescriptor.getNric().orElse(applicantToEdit.getNric());
        Qualification updatedQualification = editApplicantDescriptor.getQualification()
                .orElse(applicantToEdit.getQualification());
        InterviewDate updatedInterviewDate = editApplicantDescriptor.getInterviewDate()
                .orElse(applicantToEdit.getInterviewDate());
        JobId updatedJob = editApplicantDescriptor.getJobId().orElse(applicantToEdit.getJobId());
        ApplicantStatus applicantStatus = applicantToEdit.getApplicantStatus();
        LocalDate dateApplied = updatedDateApplied.date;
        LocalDate interviewDate = updatedInterviewDate.date;
        if (interviewDate.compareTo(dateApplied) < 0 && updatedInterviewDate.isInit) {
            throw new CommandException(MESSAGE_DATE_APPLIED_LATER_THAN_INTERVIEW_DATE);
        }
        return new Applicant(updatedName, updatedPhone, updatedEmail, updatedAddress, updatedTags, updatedDateApplied,
                updatedNric, updatedJob, updatedInterviewDate, updatedQualification, applicantStatus);
    }
private static Applicant createEditedApplicant ( Applicant applicantToEdit , EditApplicantDescriptor editApplicantDescriptor ) throws CommandException { assert applicantToEdit != null ; Name updatedName = editApplicantDescriptor . getName ( ) . orElse ( applicantToEdit . getName ( ) ) ; Phone updatedPhone = editApplicantDescriptor . getPhone ( ) . orElse ( applicantToEdit . getPhone ( ) ) ; Email updatedEmail = editApplicantDescriptor . getEmail ( ) . orElse ( applicantToEdit . getEmail ( ) ) ; Address updatedAddress = editApplicantDescriptor . getAddress ( ) . orElse ( applicantToEdit . getAddress ( ) ) ; Set < Tag > updatedTags = editApplicantDescriptor . getTags ( ) . orElse ( applicantToEdit . getTags ( ) ) ; DateApplied updatedDateApplied = editApplicantDescriptor . getDateApplied ( ) . orElse ( applicantToEdit . getDateApplied ( ) ) ; Nric updatedNric = editApplicantDescriptor . getNric ( ) . orElse ( applicantToEdit . getNric ( ) ) ; Qualification updatedQualification = editApplicantDescriptor . getQualification ( ) . orElse ( applicantToEdit . getQualification ( ) ) ; InterviewDate updatedInterviewDate = editApplicantDescriptor . getInterviewDate ( ) . orElse ( applicantToEdit . getInterviewDate ( ) ) ; JobId updatedJob = editApplicantDescriptor . getJobId ( ) . orElse ( applicantToEdit . getJobId ( ) ) ; ApplicantStatus applicantStatus = applicantToEdit . getApplicantStatus ( ) ; LocalDate dateApplied = updatedDateApplied . date ; LocalDate interviewDate = updatedInterviewDate . date ; if ( interviewDate . compareTo ( dateApplied ) < 0 && updatedInterviewDate . isInit ) { throw new CommandException ( MESSAGE_DATE_APPLIED_LATER_THAN_INTERVIEW_DATE ) ; } return new Applicant ( updatedName , updatedPhone , updatedEmail , updatedAddress , updatedTags , updatedDateApplied , updatedNric , updatedJob , updatedInterviewDate , updatedQualification , applicantStatus ) ; }
Creates and returns a {@code Applicant} with the details of {@code applicantToEdit}
 edited with {@code editApplicantDescriptor}.
Creates and returns a { @code Applicant } with the details of { @code applicantToEdit } edited with { @code editApplicantDescriptor } .