src/main/java/seedu/address/storage/storageStudent/JsonAdaptedStudent.java
public Student toModelType() throws IllegalValueException {
        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 (studentID == null) {
            throw new IllegalValueException(
                    String.format(MISSING_FIELD_MESSAGE_FORMAT, ID.class.getSimpleName()));
        }
        if (!ID.isValidId(studentID)) {
            throw new IllegalValueException(ID.MESSAGE_CONSTRAINTS);
        }
        final ID modelID = new ID(studentID);

        if (gender == null) {
            throw new IllegalValueException(
                    String.format(MISSING_FIELD_MESSAGE_FORMAT, Gender.class.getSimpleName()));
        }
        if (!Gender.isValidGender(gender)) {
            throw new IllegalValueException(Gender.MESSAGE_CONSTRAINTS);
        }
        final Gender modelGender = new Gender(gender);

        final List<ID> StudentAssignedCoursesID = new ArrayList<>();
        for (JsonStudentAdaptedID id : assignedCoursesID) {
            StudentAssignedCoursesID.add(id.toModelType());
        }
        final Set<ID> modelAssignedCoursesID = new HashSet<>(StudentAssignedCoursesID);

        final List<Tag> courseTags = new ArrayList<>();
        for (JsonStudentAdaptedTag tag : tagged) {
            courseTags.add(tag.toModelType());
        }

        final Set<Tag> modelTags = new HashSet<>(courseTags);
        return new Student(modelName, modelID, modelGender, modelAssignedCoursesID, modelTags);
    }
/**
     * Converts this Jackson-friendly adapted course object into the model's {@code Student} object.
     *
     * @throws IllegalValueException if there were any data constraints violated in the adapted
     *                               course.
     */
Converts this Jackson-friendly adapted course object into the model's  Student object.
@throws IllegalValueException if there were any data constraints violated in the adapted
course.
Converts this Jackson - friendly adapted course object into the model ' s Student object . @throws IllegalValueException if there were any data constraints violated in the adapted course .
public Student toModelType() throws IllegalValueException {
        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 (studentID == null) {
            throw new IllegalValueException(
                    String.format(MISSING_FIELD_MESSAGE_FORMAT, ID.class.getSimpleName()));
        }
        if (!ID.isValidId(studentID)) {
            throw new IllegalValueException(ID.MESSAGE_CONSTRAINTS);
        }
        final ID modelID = new ID(studentID);
        if (gender == null) {
            throw new IllegalValueException(
                    String.format(MISSING_FIELD_MESSAGE_FORMAT, Gender.class.getSimpleName()));
        }
        if (!Gender.isValidGender(gender)) {
            throw new IllegalValueException(Gender.MESSAGE_CONSTRAINTS);
        }
        final Gender modelGender = new Gender(gender);
        final List<ID> StudentAssignedCoursesID = new ArrayList<>();
        for (JsonStudentAdaptedID id : assignedCoursesID) {
            StudentAssignedCoursesID.add(id.toModelType());
        }
        final Set<ID> modelAssignedCoursesID = new HashSet<>(StudentAssignedCoursesID);
        final List<Tag> courseTags = new ArrayList<>();
        for (JsonStudentAdaptedTag tag : tagged) {
            courseTags.add(tag.toModelType());
        }
        final Set<Tag> modelTags = new HashSet<>(courseTags);
        return new Student(modelName, modelID, modelGender, modelAssignedCoursesID, modelTags);
    }
public Student toModelType ( ) throws IllegalValueException { 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 ( studentID == null ) { throw new IllegalValueException ( String . format ( MISSING_FIELD_MESSAGE_FORMAT , ID . class . getSimpleName ( ) ) ) ; } if ( ! ID . isValidId ( studentID ) ) { throw new IllegalValueException ( ID . MESSAGE_CONSTRAINTS ) ; } final ID modelID = new ID ( studentID ) ; if ( gender == null ) { throw new IllegalValueException ( String . format ( MISSING_FIELD_MESSAGE_FORMAT , Gender . class . getSimpleName ( ) ) ) ; } if ( ! Gender . isValidGender ( gender ) ) { throw new IllegalValueException ( Gender . MESSAGE_CONSTRAINTS ) ; } final Gender modelGender = new Gender ( gender ) ; final List < ID > StudentAssignedCoursesID = new ArrayList < > ( ) ; for ( JsonStudentAdaptedID id : assignedCoursesID ) { StudentAssignedCoursesID . add ( id . toModelType ( ) ) ; } final Set < ID > modelAssignedCoursesID = new HashSet < > ( StudentAssignedCoursesID ) ; final List < Tag > courseTags = new ArrayList < > ( ) ; for ( JsonStudentAdaptedTag tag : tagged ) { courseTags . add ( tag . toModelType ( ) ) ; } final Set < Tag > modelTags = new HashSet < > ( courseTags ) ; return new Student ( modelName , modelID , modelGender , modelAssignedCoursesID , modelTags ) ; }
Converts this Jackson-friendly adapted course object into the model's {@code Student} object.
Converts this Jackson - friendly adapted course object into the model ' s { @code Student } object .