class EnrolmentBenefitResourceConverter extends AbstractConverter<EnrolmentBenefitResource, EnrolmentBenefit> {

	@Override
	public EnrolmentBenefit convert(final EnrolmentBenefitResource source, final EnrolmentBenefit target) {

		if (source.getEnrolmentId() != null) {
			Enrolment enrolment = new Enrolment();
			enrolment.setId(source.getEnrolmentId());
			target.setEnrolment(enrolment);
		}
		
		if (source.getBenefitId() != null) {
			Benefit benefit = new Benefit();
			benefit.setId(source.getBenefitId());
			target.setBenefit(benefit);
		}
		
		if (source.getPersonPaperId() != null) {
			PersonPaper personpaper = new PersonPaper();
			personpaper.setId(source.getPersonPaperId());
			target.setPersonPaper(personpaper);
		}
		
		return target;
	}

}