class EnrolmentEnrolmentSubjectResourceConverter extends	AbstractConverter<EnrolmentEnrolmentSubjectResource, EnrolmentEnrolmentSubject> {

    @Override
    public EnrolmentEnrolmentSubject convert(final EnrolmentEnrolmentSubjectResource source, final EnrolmentEnrolmentSubject target) {
	target.setId(source.getId());
	target.setMark(source.getMark());
	if (source.getEnrolmentId() != null) {
	    Enrolment enrolment = new Enrolment();
	    enrolment.setId(source.getEnrolmentId());
	    
	    target.setEnrolment(enrolment);
	}
	
	if (source.getEnrolmentSubjectId() != null) {
	    EnrolmentSubject enrolmentSubject = new EnrolmentSubject();
	    enrolmentSubject.setId(source.getEnrolmentSubjectId());
	    
	    target.setEnrolmentSubject(enrolmentSubject);
	}
	
	if (source.getPersonEnrolmentSubjectId() != null) {
	    PersonEnrolmentSubject personEnrolmentSubject = new PersonEnrolmentSubject();
	    personEnrolmentSubject.setId(source.getPersonEnrolmentSubjectId());
	    
	    target.setPersonEnrolmentSubject(personEnrolmentSubject);
	}
	return target;
    }

}