Dozer-List-DO与VO转换

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import java.util.ArrayList;
import java.util.List;

import org.dozer.Mapper;

public class DozerUtils {

/**
* Encapsulate the method of dozer processing set: List < s > > > < T > List
*/
public static <T, S> List<T> mapList(final Mapper mapper, List<S> sourceList, Class<T> targetObjectClass) {
List<T> targetList = new ArrayList<T>();
for (S s : sourceList) {
targetList.add(mapper.map(s, targetObjectClass));
}
return targetList;
}
}
作者

Etsu

发布于

2022-12-29

更新于

2022-12-29

许可协议

评论