List<Integer> collect = objects.stream().map(Student::getId).collect(Collectors.toList());
请教下各位,这个方法怎么避免空指针呀
比如后面紧跟查询语句的话, select * from table where id in(collect) 就不对了
...全文
13264打赏收藏
stream流里面的空指针
List collect = objects.stream().map(Student::getId).collect(Collectors.toList()); 请教下各位,这个方法怎么避免空指针呀 比如后面紧跟查询语句的话, select * from table where id in(collect) 就不对了