src/main/java/seedu/address/storage/JsonAdaptedApplicant.java
public Applicant toModelType() throws IllegalValueException {
        final List<Tag> applicantTags = new ArrayList<>();
        for (JsonAdaptedTag tag : tagged) {
            applicantTags.add(tag.toModelType());
        }

        if (name == null) {
            throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT, Name.class.getSimpleName()));
        }
        if (!Name.isValidName(name)) {
            throw new IllegalValueException(Name.MESSAGE_CONSTRAINTS);
        }
        final Name modelName = new Name(name);

        if (phone == null) {
            throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT, Phone.class.getSimpleName()));
        }
        if (!Phone.isValidPhone(phone)) {
            throw new IllegalValueException(Phone.MESSAGE_CONSTRAINTS);
        }
        final Phone modelPhone = new Phone(phone);

        if (email == null) {
            throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT, Email.class.getSimpleName()));
        }
        if (!Email.isValidEmail(email)) {
            throw new IllegalValueException(Email.MESSAGE_CONSTRAINTS);
        }
        final Email modelEmail = new Email(email);

        if (address == null) {
            throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT, Address.class.getSimpleName()));
        }
        if (!Address.isValidAddress(address)) {
            throw new IllegalValueException(Address.MESSAGE_CONSTRAINTS);
        }
        final Address modelAddress = new Address(address);

        final Set<Tag> modelTags = new HashSet<>(applicantTags);

        if (nric == null) {
            throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT, Nric.class.getSimpleName()));
        }

        if (!Nric.isValidNric(nric)) {
            throw new IllegalValueException(Nric.MESSAGE_CONSTRAINTS);
        }
        final Nric modelNric = new Nric(nric);

        if (dateApplied == null) {
            throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT,
                    DateApplied.class.getSimpleName()));
        }

        if (!DateApplied.isValidDateApplied(dateApplied)) {
            throw new IllegalValueException(DateApplied.MESSAGE_CONSTRAINTS);
        }
        final DateApplied modelDateApplied = new DateApplied(dateApplied);

        if (interviewDate == null) {
            throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT,
                    InterviewDate.class.getSimpleName()));
        }

        if (!InterviewDate.isValidInterviewDate(interviewDate)) {
            throw new IllegalValueException(InterviewDate.MESSAGE_CONSTRAINTS);
        }
        final InterviewDate modelInterviewDate = new InterviewDate(interviewDate);

        if (job == null) {
            throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT, JobId.class.getSimpleName()));
        }

        if (!JobId.isValidJobId(job)) {
            throw new IllegalValueException(JobId.MESSAGE_CONSTRAINTS);
        }
        final JobId modelJobId = new JobId(job);

        if (qualification == null) {
            throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT,
                    Qualification.class.getSimpleName()));
        }

        if (!Qualification.isValidQualification(qualification)) {
            throw new IllegalValueException(Qualification.MESSAGE_CONSTRAINTS);
        }
        final Qualification modelQualification = new Qualification(qualification);

        if (applicationStatus == null) {
            throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT,
                    ApplicantStatus.class.getSimpleName()));
        }

        if (!ApplicantStatus.isValidStatus(applicationStatus)) {
            throw new IllegalValueException(ApplicantStatus.MESSAGE_CONSTRAINTS);
        }

        final ApplicantStatus modelApplicantStatus = new ApplicantStatus(applicationStatus);

        return new Applicant(modelName, modelPhone, modelEmail, modelAddress, modelTags, modelDateApplied,
                modelNric, modelJobId, modelInterviewDate, modelQualification, modelApplicantStatus);
    }
/**
     * Converts this Jackson-friendly adapted applicant object into the model's {@code Applicant} object.
     *
     * @throws IllegalValueException if there were any data constraints violated in the adapted Applicant.
     */
Converts this Jackson-friendly adapted applicant object into the model's  Applicant object.
@throws IllegalValueException if there were any data constraints violated in the adapted Applicant.
Converts this Jackson - friendly adapted applicant object into the model ' s Applicant object . @throws IllegalValueException if there were any data constraints violated in the adapted Applicant .
public Applicant toModelType() throws IllegalValueException {
        final List<Tag> applicantTags = new ArrayList<>();
        for (JsonAdaptedTag tag : tagged) {
            applicantTags.add(tag.toModelType());
        }
        if (name == null) {
            throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT, Name.class.getSimpleName()));
        }
        if (!Name.isValidName(name)) {
            throw new IllegalValueException(Name.MESSAGE_CONSTRAINTS);
        }
        final Name modelName = new Name(name);
        if (phone == null) {
            throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT, Phone.class.getSimpleName()));
        }
        if (!Phone.isValidPhone(phone)) {
            throw new IllegalValueException(Phone.MESSAGE_CONSTRAINTS);
        }
        final Phone modelPhone = new Phone(phone);
        if (email == null) {
            throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT, Email.class.getSimpleName()));
        }
        if (!Email.isValidEmail(email)) {
            throw new IllegalValueException(Email.MESSAGE_CONSTRAINTS);
        }
        final Email modelEmail = new Email(email);
        if (address == null) {
            throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT, Address.class.getSimpleName()));
        }
        if (!Address.isValidAddress(address)) {
            throw new IllegalValueException(Address.MESSAGE_CONSTRAINTS);
        }
        final Address modelAddress = new Address(address);
        final Set<Tag> modelTags = new HashSet<>(applicantTags);
        if (nric == null) {
            throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT, Nric.class.getSimpleName()));
        }
        if (!Nric.isValidNric(nric)) {
            throw new IllegalValueException(Nric.MESSAGE_CONSTRAINTS);
        }
        final Nric modelNric = new Nric(nric);
        if (dateApplied == null) {
            throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT,
                    DateApplied.class.getSimpleName()));
        }
        if (!DateApplied.isValidDateApplied(dateApplied)) {
            throw new IllegalValueException(DateApplied.MESSAGE_CONSTRAINTS);
        }
        final DateApplied modelDateApplied = new DateApplied(dateApplied);
        if (interviewDate == null) {
            throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT,
                    InterviewDate.class.getSimpleName()));
        }
        if (!InterviewDate.isValidInterviewDate(interviewDate)) {
            throw new IllegalValueException(InterviewDate.MESSAGE_CONSTRAINTS);
        }
        final InterviewDate modelInterviewDate = new InterviewDate(interviewDate);
        if (job == null) {
            throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT, JobId.class.getSimpleName()));
        }
        if (!JobId.isValidJobId(job)) {
            throw new IllegalValueException(JobId.MESSAGE_CONSTRAINTS);
        }
        final JobId modelJobId = new JobId(job);
        if (qualification == null) {
            throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT,
                    Qualification.class.getSimpleName()));
        }
        if (!Qualification.isValidQualification(qualification)) {
            throw new IllegalValueException(Qualification.MESSAGE_CONSTRAINTS);
        }
        final Qualification modelQualification = new Qualification(qualification);
        if (applicationStatus == null) {
            throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT,
                    ApplicantStatus.class.getSimpleName()));
        }
        if (!ApplicantStatus.isValidStatus(applicationStatus)) {
            throw new IllegalValueException(ApplicantStatus.MESSAGE_CONSTRAINTS);
        }
        final ApplicantStatus modelApplicantStatus = new ApplicantStatus(applicationStatus);
        return new Applicant(modelName, modelPhone, modelEmail, modelAddress, modelTags, modelDateApplied,
                modelNric, modelJobId, modelInterviewDate, modelQualification, modelApplicantStatus);
    }
public Applicant toModelType ( ) throws IllegalValueException { final List < Tag > applicantTags = new ArrayList < > ( ) ; for ( JsonAdaptedTag tag : tagged ) { applicantTags . add ( tag . toModelType ( ) ) ; } if ( name == null ) { throw new IllegalValueException ( String . format ( MISSING_FIELD_MESSAGE_FORMAT , Name . class . getSimpleName ( ) ) ) ; } if ( ! Name . isValidName ( name ) ) { throw new IllegalValueException ( Name . MESSAGE_CONSTRAINTS ) ; } final Name modelName = new Name ( name ) ; if ( phone == null ) { throw new IllegalValueException ( String . format ( MISSING_FIELD_MESSAGE_FORMAT , Phone . class . getSimpleName ( ) ) ) ; } if ( ! Phone . isValidPhone ( phone ) ) { throw new IllegalValueException ( Phone . MESSAGE_CONSTRAINTS ) ; } final Phone modelPhone = new Phone ( phone ) ; if ( email == null ) { throw new IllegalValueException ( String . format ( MISSING_FIELD_MESSAGE_FORMAT , Email . class . getSimpleName ( ) ) ) ; } if ( ! Email . isValidEmail ( email ) ) { throw new IllegalValueException ( Email . MESSAGE_CONSTRAINTS ) ; } final Email modelEmail = new Email ( email ) ; if ( address == null ) { throw new IllegalValueException ( String . format ( MISSING_FIELD_MESSAGE_FORMAT , Address . class . getSimpleName ( ) ) ) ; } if ( ! Address . isValidAddress ( address ) ) { throw new IllegalValueException ( Address . MESSAGE_CONSTRAINTS ) ; } final Address modelAddress = new Address ( address ) ; final Set < Tag > modelTags = new HashSet < > ( applicantTags ) ; if ( nric == null ) { throw new IllegalValueException ( String . format ( MISSING_FIELD_MESSAGE_FORMAT , Nric . class . getSimpleName ( ) ) ) ; } if ( ! Nric . isValidNric ( nric ) ) { throw new IllegalValueException ( Nric . MESSAGE_CONSTRAINTS ) ; } final Nric modelNric = new Nric ( nric ) ; if ( dateApplied == null ) { throw new IllegalValueException ( String . format ( MISSING_FIELD_MESSAGE_FORMAT , DateApplied . class . getSimpleName ( ) ) ) ; } if ( ! DateApplied . isValidDateApplied ( dateApplied ) ) { throw new IllegalValueException ( DateApplied . MESSAGE_CONSTRAINTS ) ; } final DateApplied modelDateApplied = new DateApplied ( dateApplied ) ; if ( interviewDate == null ) { throw new IllegalValueException ( String . format ( MISSING_FIELD_MESSAGE_FORMAT , InterviewDate . class . getSimpleName ( ) ) ) ; } if ( ! InterviewDate . isValidInterviewDate ( interviewDate ) ) { throw new IllegalValueException ( InterviewDate . MESSAGE_CONSTRAINTS ) ; } final InterviewDate modelInterviewDate = new InterviewDate ( interviewDate ) ; if ( job == null ) { throw new IllegalValueException ( String . format ( MISSING_FIELD_MESSAGE_FORMAT , JobId . class . getSimpleName ( ) ) ) ; } if ( ! JobId . isValidJobId ( job ) ) { throw new IllegalValueException ( JobId . MESSAGE_CONSTRAINTS ) ; } final JobId modelJobId = new JobId ( job ) ; if ( qualification == null ) { throw new IllegalValueException ( String . format ( MISSING_FIELD_MESSAGE_FORMAT , Qualification . class . getSimpleName ( ) ) ) ; } if ( ! Qualification . isValidQualification ( qualification ) ) { throw new IllegalValueException ( Qualification . MESSAGE_CONSTRAINTS ) ; } final Qualification modelQualification = new Qualification ( qualification ) ; if ( applicationStatus == null ) { throw new IllegalValueException ( String . format ( MISSING_FIELD_MESSAGE_FORMAT , ApplicantStatus . class . getSimpleName ( ) ) ) ; } if ( ! ApplicantStatus . isValidStatus ( applicationStatus ) ) { throw new IllegalValueException ( ApplicantStatus . MESSAGE_CONSTRAINTS ) ; } final ApplicantStatus modelApplicantStatus = new ApplicantStatus ( applicationStatus ) ; return new Applicant ( modelName , modelPhone , modelEmail , modelAddress , modelTags , modelDateApplied , modelNric , modelJobId , modelInterviewDate , modelQualification , modelApplicantStatus ) ; }
Converts this Jackson-friendly adapted applicant object into the model's {@code Applicant} object.
Converts this Jackson - friendly adapted applicant object into the model ' s { @code Applicant } object .