Bean拷贝案例:
public static <O, V> List<V> copyBeanList(List<O> list, Class<V> clazz) {
return list.stream()
.map(o -> copyBean(o, clazz))
.collect(Collectors.toList());
}
过滤status为0的:
categories.stream()
.filter(o -> "0".equals(o.getStatus()))
.collect(Collectors.toList());