class SpecialtyConverter extends AbstractConverter<Specialty, SpecialtyResource> {

	@Override
	public SpecialtyResource convert(final Specialty source, final SpecialtyResource target) {
		
		target.setId(source.getId());
		target.setAbbrName(source.getAbbrName());
		target.setBegDate(source.getBegDate());
		target.setCipher(source.getCipher());
		target.setEndDate(source.getEndDate());
		target.setName(source.getName());

		if (source.getSpecialtyType() != null) {
			target.setSpecialtyTypeId(source.getSpecialtyType().getId());
		}

		if (source.getParent() != null) {
			target.setParentId(source.getParent().getId());
		}
		
		return target;
	}

}