我有一个ArrayList(inputList)来解析这些数据:
id,name,quantity
1,foo,10
2,bar,20
3,foo,10
4,bar,10
5,qwerty,1
代码:
...
List<FooRow> inputList = new ArrayList<FooRow>();
inputList = br.lines().map(mapToFooRow).collect(Collectors.toList());
...
public class FooRow{
private Integer id;
private String name;
private Integer value;
}
name,value
foo,20
bar,30
qwerty,1
如何在lambda表达式中创建类收集器来执行此操作?
谢谢。