mapstruct-plus
mapstruct-plus copied to clipboard
List 建议改为Collection
public <S, T> List<T> convert(List<S> source, Class<T> targetType) {
if (source == null || source.isEmpty()) {
return new ArrayList<>();
}
return source.stream().map(item -> convert(item, targetType)).collect(Collectors.toList());
}