class EnrolmentTypeResourceConverter extends AbstractConverter<EnrolmentTypeResource, EnrolmentType> {

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

}