package com.jasamedika.medifirst2000.converter;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;

import com.jasamedika.medifirst2000.converter.base.BaseVoConverter;
import com.jasamedika.medifirst2000.entities.NotifMessagingScheduler;
import com.jasamedika.medifirst2000.vo.NotifMessagingSchedulerVO;

@Component
public class NotifMessagingSchedulerConverter  implements BaseVoConverter<NotifMessagingSchedulerVO, NotifMessagingScheduler> {

	@Override
	public NotifMessagingScheduler transferVOToModel(NotifMessagingSchedulerVO vo, NotifMessagingScheduler model) {
		if (null == model)
			model = new NotifMessagingScheduler();
		
		BeanUtils.copyProperties(vo, model);

		return model;
	}

	@Override
	public List<NotifMessagingSchedulerVO> transferListOfModelToListOfVO(List<NotifMessagingScheduler> models,
			List<NotifMessagingSchedulerVO> vos) {
		if (null == vos)
			vos = new ArrayList<NotifMessagingSchedulerVO>();

		if (null == models)
			return vos;

		for (NotifMessagingScheduler notifMessagingScheduler : models) {
			NotifMessagingSchedulerVO vo = new NotifMessagingSchedulerVO();
			vo=transferModelToVO(notifMessagingScheduler, vo);
			vos.add(vo);
		}

		return vos;
	}

	@Override
	public NotifMessagingSchedulerVO transferModelToVO(NotifMessagingScheduler model, NotifMessagingSchedulerVO vo) {
		
		
		if (null == vo)
			vo = new NotifMessagingSchedulerVO();
			BeanUtils.copyProperties(model, vo);
		return vo;
	}

}
