class DegreeResourceConverter extends AbstractConverter<DegreeResource, Degree> {

	@Override
	public Degree convert(final DegreeResource source, final Degree target) {

		if (source.getPersonId() != null) {
			Person person = new Person();
			person.setId(source.getPersonId());
			target.setPerson(person);
		}
		
		if (source.getDegreeTypeId() != null) {
			DegreeType degreeType = new DegreeType();
			degreeType.setId(source.getDegreeTypeId());
			target.setDegreeType(degreeType);
		}
		
		return target;
	}

}