class PublicActivityConverter extends AbstractConverter<PublicActivity, PublicActivityResource> {

	@Override
	public PublicActivityResource convert(final PublicActivity source, final PublicActivityResource target) {
		
		target.setId(source.getId());
		target.setName(source.getName());
		target.setBegDate(source.getBegDate());
		target.setEndDate(source.getEndDate());
		
		if (source.getPublicActivityTypeType() != null) {
			target.setPublicActivityTypeId(source.getPublicActivityTypeType().getId());
		}
		
		if (source.getTimePeriod() != null) {
			target.setTimePeriodId(source.getTimePeriod().getId());
		}
		
		return target;
	}

}