src/main/java/seedu/address/storage/JsonAdaptedJob.java
public Job toModelType() throws IllegalValueException {

        if (jobTitle == null) {
            throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT,
                    JobTitle.class.getSimpleName()));
        }
        if (!JobTitle.isValidJobTitle(jobTitle)) {
            throw new IllegalValueException(JobTitle.MESSAGE_CONSTRAINTS);
        }
        final JobTitle modelJobTitle = new JobTitle(jobTitle);

        if (companyName == null) {
            throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT,
                    CompanyName.class.getSimpleName()));
        }
        if (!CompanyName.isValidCompanyName(companyName)) {
            throw new IllegalValueException(CompanyName.MESSAGE_CONSTRAINTS);
        }
        final CompanyName modelCompanyName = new CompanyName(companyName);

        if (id == null) {
            throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT, JobId.class.getSimpleName()));
        }
        if (!JobId.isValidJobId(id)) {
            throw new IllegalValueException(JobId.MESSAGE_CONSTRAINTS);
        }
        final JobId modelJobId = new JobId(id);

        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);

        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 (jobStatus == null) {
            throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT,
                    JobStatus.class.getSimpleName()));
        }
        if (!JobStatus.isValid(jobStatus)) {
            throw new IllegalValueException(JobStatus.MESSAGE_CONSTRAINTS);
        }

        final JobStatus modelJobStatus = new JobStatus(jobStatus);

        if (position == null) {
            throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT,
                    Position.class.getSimpleName()));
        }
        if (!Position.validPosition(position)) {
            throw new IllegalValueException(Position.MESSAGE_CONSTRAINTS);
        }

        final Position modelPosition = new Position(position);

        if (salary == null) {
            throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT,
                    Salary.class.getSimpleName()));
        }
        if (!Salary.isValidSalary(salary)) {
            throw new IllegalValueException(Salary.MESSAGE_CONSTRAINTS);
        }

        final Salary modelSalary = new Salary(salary);

        return new Job(modelJobTitle, modelCompanyName, modelJobId, modelAddress, modelQualification,
                modelJobStatus, modelPosition, modelSalary);
    }
/**
     * Converts this Jackson-friendly adapted job object into the model's {@code Job} object.
     *
     * @throws IllegalValueException if there were any data constraints violated in the adapted person.
     */
Converts this Jackson-friendly adapted job object into the model's  Job object.
@throws IllegalValueException if there were any data constraints violated in the adapted person.
Converts this Jackson - friendly adapted job object into the model ' s Job object . @throws IllegalValueException if there were any data constraints violated in the adapted person .
public Job toModelType() throws IllegalValueException {
        if (jobTitle == null) {
            throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT,
                    JobTitle.class.getSimpleName()));
        }
        if (!JobTitle.isValidJobTitle(jobTitle)) {
            throw new IllegalValueException(JobTitle.MESSAGE_CONSTRAINTS);
        }
        final JobTitle modelJobTitle = new JobTitle(jobTitle);
        if (companyName == null) {
            throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT,
                    CompanyName.class.getSimpleName()));
        }
        if (!CompanyName.isValidCompanyName(companyName)) {
            throw new IllegalValueException(CompanyName.MESSAGE_CONSTRAINTS);
        }
        final CompanyName modelCompanyName = new CompanyName(companyName);
        if (id == null) {
            throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT, JobId.class.getSimpleName()));
        }
        if (!JobId.isValidJobId(id)) {
            throw new IllegalValueException(JobId.MESSAGE_CONSTRAINTS);
        }
        final JobId modelJobId = new JobId(id);
        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);
        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 (jobStatus == null) {
            throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT,
                    JobStatus.class.getSimpleName()));
        }
        if (!JobStatus.isValid(jobStatus)) {
            throw new IllegalValueException(JobStatus.MESSAGE_CONSTRAINTS);
        }
        final JobStatus modelJobStatus = new JobStatus(jobStatus);
        if (position == null) {
            throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT,
                    Position.class.getSimpleName()));
        }
        if (!Position.validPosition(position)) {
            throw new IllegalValueException(Position.MESSAGE_CONSTRAINTS);
        }
        final Position modelPosition = new Position(position);
        if (salary == null) {
            throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT,
                    Salary.class.getSimpleName()));
        }
        if (!Salary.isValidSalary(salary)) {
            throw new IllegalValueException(Salary.MESSAGE_CONSTRAINTS);
        }
        final Salary modelSalary = new Salary(salary);
        return new Job(modelJobTitle, modelCompanyName, modelJobId, modelAddress, modelQualification,
                modelJobStatus, modelPosition, modelSalary);
    }
public Job toModelType ( ) throws IllegalValueException { if ( jobTitle == null ) { throw new IllegalValueException ( String . format ( MISSING_FIELD_MESSAGE_FORMAT , JobTitle . class . getSimpleName ( ) ) ) ; } if ( ! JobTitle . isValidJobTitle ( jobTitle ) ) { throw new IllegalValueException ( JobTitle . MESSAGE_CONSTRAINTS ) ; } final JobTitle modelJobTitle = new JobTitle ( jobTitle ) ; if ( companyName == null ) { throw new IllegalValueException ( String . format ( MISSING_FIELD_MESSAGE_FORMAT , CompanyName . class . getSimpleName ( ) ) ) ; } if ( ! CompanyName . isValidCompanyName ( companyName ) ) { throw new IllegalValueException ( CompanyName . MESSAGE_CONSTRAINTS ) ; } final CompanyName modelCompanyName = new CompanyName ( companyName ) ; if ( id == null ) { throw new IllegalValueException ( String . format ( MISSING_FIELD_MESSAGE_FORMAT , JobId . class . getSimpleName ( ) ) ) ; } if ( ! JobId . isValidJobId ( id ) ) { throw new IllegalValueException ( JobId . MESSAGE_CONSTRAINTS ) ; } final JobId modelJobId = new JobId ( id ) ; 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 ) ; 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 ( jobStatus == null ) { throw new IllegalValueException ( String . format ( MISSING_FIELD_MESSAGE_FORMAT , JobStatus . class . getSimpleName ( ) ) ) ; } if ( ! JobStatus . isValid ( jobStatus ) ) { throw new IllegalValueException ( JobStatus . MESSAGE_CONSTRAINTS ) ; } final JobStatus modelJobStatus = new JobStatus ( jobStatus ) ; if ( position == null ) { throw new IllegalValueException ( String . format ( MISSING_FIELD_MESSAGE_FORMAT , Position . class . getSimpleName ( ) ) ) ; } if ( ! Position . validPosition ( position ) ) { throw new IllegalValueException ( Position . MESSAGE_CONSTRAINTS ) ; } final Position modelPosition = new Position ( position ) ; if ( salary == null ) { throw new IllegalValueException ( String . format ( MISSING_FIELD_MESSAGE_FORMAT , Salary . class . getSimpleName ( ) ) ) ; } if ( ! Salary . isValidSalary ( salary ) ) { throw new IllegalValueException ( Salary . MESSAGE_CONSTRAINTS ) ; } final Salary modelSalary = new Salary ( salary ) ; return new Job ( modelJobTitle , modelCompanyName , modelJobId , modelAddress , modelQualification , modelJobStatus , modelPosition , modelSalary ) ; }
Converts this Jackson-friendly adapted job object into the model's {@code Job} object.
Converts this Jackson - friendly adapted job object into the model ' s { @code Job } object .