class OrderTypeResourceConverter extends AbstractConverter<OrderTypeResource, OrderType> {

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

}