class BenefitConverter extends AbstractConverter<Benefit, BenefitResource> {

	@Override
	public BenefitResource convert(final Benefit source, final BenefitResource target) {
		
		target.setId(source.getId());
		target.setAbbrName(source.getAbbrName());
		target.setName(source.getName());
		target.setBegDate(source.getBegDate());
		target.setEndDate(source.getEndDate());
		target.setDescription(source.getDescription());
		
		if (source.getParent() != null) {
			target.setParentId(source.getParent().getId());
		}
		
		if (source.getBenefitType() != null) {
			target.setBenefitTypeId(source.getBenefitType().getId());
		}
		
		return target;
	}

}