class SpecialtyResourceConverter extends AbstractConverter<SpecialtyResource, Specialty> {

	@Override
	public Specialty convert(final SpecialtyResource source, final Specialty target) {

		if (source.getParentId() != null) {
			Specialty parent = new Specialty();
			parent.setId(source.getParentId());
			target.setParent(parent);
		}
		
		if (source.getSpecialtyTypeId() != null) {
			SpecialtyType specialtyType = new SpecialtyType();
			specialtyType.setId(source.getSpecialtyTypeId());
			target.setSpecialtyType(specialtyType);
		}		
		
		target.setAbbrName(source.getAbbrName());
		target.setBegDate(source.getBegDate());
		target.setCipher(source.getCipher());
		target.setEndDate(source.getEndDate());
		target.setName(source.getName());
		
		return target;
	}

}