不需要生成新的对象数据,只需要在原对象数据上进行操作即可。
newDatas.Stream().filter(i->i.getName() ==null || StringUtils.isNotBlank(i.getName())).forEach(x->x.setAge("18"));
不要在末尾使用Collectors即可,这样流的操作会在原数据对象上进行。

不需要生成新的对象数据,只需要在原对象数据上进行操作即可。
newDatas.Stream().filter(i->i.getName() ==null || StringUtils.isNotBlank(i.getName())).forEach(x->x.setAge("18"));
不要在末尾使用Collectors即可,这样流的操作会在原数据对象上进行。