src/main/java/seedu/address/storage/JsonSerializableAddressBook.java
public AddressBook toModelType() throws IllegalValueException {
        AddressBook addressBook = new AddressBook();
        for (JsonAdaptedJob jsonAdaptedJob : jobs) {
            Job job = jsonAdaptedJob.toModelType();
            if (addressBook.hasJob(job)) {
                throw new IllegalValueException(MESSAGE_DUPLICATE_JOB);
            }
            addressBook.addJob(job);
        }
        for (JsonAdaptedApplicant jsonAdaptedApplicant : applicants) {
            Applicant applicant = jsonAdaptedApplicant.toModelType();
            if (addressBook.hasApplicant(applicant)) {
                throw new IllegalValueException(MESSAGE_DUPLICATE_APPLICANT);
            }
            addressBook.addApplicant(applicant);
        }
        addressBook.setIdCount(this.idCount);
        return addressBook;
    }
/**
     * Converts this address book into the model's {@code AddressBook} object.
     *
     * @throws IllegalValueException if there were any data constraints violated.
     */
Converts this address book into the model's  AddressBook object.
@throws IllegalValueException if there were any data constraints violated.
Converts this address book into the model ' s AddressBook object . @throws IllegalValueException if there were any data constraints violated .
public AddressBook toModelType() throws IllegalValueException {
        AddressBook addressBook = new AddressBook();
        for (JsonAdaptedJob jsonAdaptedJob : jobs) {
            Job job = jsonAdaptedJob.toModelType();
            if (addressBook.hasJob(job)) {
                throw new IllegalValueException(MESSAGE_DUPLICATE_JOB);
            }
            addressBook.addJob(job);
        }
        for (JsonAdaptedApplicant jsonAdaptedApplicant : applicants) {
            Applicant applicant = jsonAdaptedApplicant.toModelType();
            if (addressBook.hasApplicant(applicant)) {
                throw new IllegalValueException(MESSAGE_DUPLICATE_APPLICANT);
            }
            addressBook.addApplicant(applicant);
        }
        addressBook.setIdCount(this.idCount);
        return addressBook;
    }
public AddressBook toModelType ( ) throws IllegalValueException { AddressBook addressBook = new AddressBook ( ) ; for ( JsonAdaptedJob jsonAdaptedJob : jobs ) { Job job = jsonAdaptedJob . toModelType ( ) ; if ( addressBook . hasJob ( job ) ) { throw new IllegalValueException ( MESSAGE_DUPLICATE_JOB ) ; } addressBook . addJob ( job ) ; } for ( JsonAdaptedApplicant jsonAdaptedApplicant : applicants ) { Applicant applicant = jsonAdaptedApplicant . toModelType ( ) ; if ( addressBook . hasApplicant ( applicant ) ) { throw new IllegalValueException ( MESSAGE_DUPLICATE_APPLICANT ) ; } addressBook . addApplicant ( applicant ) ; } addressBook . setIdCount ( this . idCount ) ; return addressBook ; }
Converts this address book into the model's {@code AddressBook} object.
Converts this address book into the model ' s { @code AddressBook } object .