package com.qianwen.smartman.modules.notify.convert; import java.util.ArrayList; import java.util.List; import com.qianwen.smartman.modules.notify.dto.NotifySubscriberDTO; import com.qianwen.smartman.modules.notify.entity.NotifySubscriberEntity; /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/notify/convert/NotifySubscriberConvertImpl.class */ public class NotifySubscriberConvertImpl implements NotifySubscriberConvert { @Override // org.springblade.modules.notify.convert.NotifySubscriberConvert public NotifySubscriberEntity convertToEntity(NotifySubscriberDTO sources) { if (sources == null) { return null; } NotifySubscriberEntity notifySubscriberEntity = new NotifySubscriberEntity(); if (sources.getId() != null) { notifySubscriberEntity.setId(Long.valueOf(Long.parseLong(sources.getId()))); } notifySubscriberEntity.setStatus(sources.getStatus()); notifySubscriberEntity.setSubscriber(sources.getSubscriber()); notifySubscriberEntity.setBusinessKey(sources.getBusinessKey()); notifySubscriberEntity.setBusinessName(sources.getBusinessName()); notifySubscriberEntity.setDescription(sources.getDescription()); return notifySubscriberEntity; } @Override // org.springblade.modules.notify.convert.NotifySubscriberConvert public NotifySubscriberDTO convertToDto(NotifySubscriberEntity sources) { if (sources == null) { return null; } NotifySubscriberDTO notifySubscriberDTO = new NotifySubscriberDTO(); if (sources.getId() != null) { notifySubscriberDTO.setId(String.valueOf(sources.getId())); } notifySubscriberDTO.setSubscriber(sources.getSubscriber()); notifySubscriberDTO.setBusinessKey(sources.getBusinessKey()); notifySubscriberDTO.setBusinessName(sources.getBusinessName()); notifySubscriberDTO.setDescription(sources.getDescription()); notifySubscriberDTO.setStatus(sources.getStatus()); return notifySubscriberDTO; } @Override // org.springblade.modules.notify.convert.NotifySubscriberConvert public List convertToDTOList(List sources) { if (sources == null) { return null; } List list = new ArrayList<>(sources.size()); for (NotifySubscriberEntity notifySubscriberEntity : sources) { list.add(convertToDto(notifySubscriberEntity)); } return list; } }