class PublicActivityAwardResourceConverter extends AbstractConverter<PublicActivityAwardResource, PublicActivityAward> {

	@Override
	public PublicActivityAward convert(final PublicActivityAwardResource source, final PublicActivityAward target) {

		target.setAwardName(source.getAwardName());
		target.setBonus(source.getBonus());
		target.setBegDate(source.getBegDate());
		target.setEndDate(source.getEndDate());
		
		if (source.getPublicActivityId() != null) {
			PublicActivity publicActivity = new PublicActivity();
			publicActivity.setId(source.getPublicActivityId());
			target.setPublicActivity(publicActivity);
		}
		
		if (source.getEnrolmentSubjectId() != null) {
			EnrolmentSubject enrolmentSubject = new EnrolmentSubject();
			enrolmentSubject.setId(source.getEnrolmentSubjectId());
			target.setEnrolmentSubject(enrolmentSubject);
		}
		
		return target;
	}

}