class EnrolmentStatusResourceConverter extends AbstractConverter<EnrolmentStatusResource, EnrolmentStatus> {

	@Override
	public EnrolmentStatus convert(final EnrolmentStatusResource source, final EnrolmentStatus target) {
		
	    	target.setIsContract(source.getIsContract());
	    	target.setIsState(source.getIsState());
	    
		if (source.getEnrolmentId() != null) {
			Enrolment enrolment = new Enrolment();
			enrolment.setId(source.getEnrolmentId());
			target.setEnrolment(enrolment);
		}
		
		if (source.getSpecOfferWaveId() != null) {
			SpecOfferWave specOfferWave = new SpecOfferWave();
			specOfferWave.setId(source.getSpecOfferWaveId());
			target.setSpecOfferWave(specOfferWave);
		}
		
		if (source.getEnrolmentStatusTypeId() != null) {
			EnrolmentStatusType enrolmentStatusType = new EnrolmentStatusType();
			enrolmentStatusType.setId(source.getEnrolmentStatusTypeId());
			target.setEnrolmentStatusType(enrolmentStatusType);
		}
		
		return target;
	}

}