package com.pollex.pam.service.mapper;
|
|
import static java.util.stream.Collectors.toList;
|
|
import java.util.List;
|
|
import org.springframework.beans.BeanUtils;
|
import org.springframework.stereotype.Service;
|
|
import com.pollex.pam.domain.AppointmentCustomerView;
|
import com.pollex.pam.service.dto.AppointmentCustomerViewDTO;
|
|
@Service
|
public class AppointmentCustomerViewMapper {
|
|
public AppointmentCustomerViewDTO toAppointmentCustomerViewDTO(AppointmentCustomerView source) {
|
AppointmentCustomerViewDTO target = new AppointmentCustomerViewDTO();
|
BeanUtils.copyProperties(source, target);
|
return target;
|
}
|
|
public List<AppointmentCustomerViewDTO> toAppointmentCustomerViewDTO(
|
List<AppointmentCustomerView> source) {
|
return source.stream().map(s -> toAppointmentCustomerViewDTO(s))
|
.collect(toList());
|
}
|
}
|