class EnrolmentSubjectResourceConverter extends AbstractConverter<EnrolmentSubjectResource, EnrolmentSubject> {

	@Override
	public EnrolmentSubject convert(final EnrolmentSubjectResource source, final EnrolmentSubject target) {
		
		target.setAbbrName(source.getAbbrName());
		target.setName(source.getName());
		target.setIsTesting(source.getIsTesting());
		
		if (source.getParentId() != null) {
			EnrolmentSubject parent = new EnrolmentSubject();
			parent.setId(source.getParentId());
			
			target.setParent(parent);
		}
		
		return target;
	}

}