我有以下代码:
categoryList = Prices.stream()
               .filter(price -> price.getPrice() != null)
               .map(this::createCategory)
               .filter(Objects::nonNull)
               .collect(Collectors.toList());该方法如下所示:
private Category createCategory(PriceCategory price) {
        Category category = new Category();
        category.setId(price.getId());
        return category;
    }我想向类似createCategory的createCategory(PriceCategory price, response)方法中添加一个新参数,但我不知道如何将这个新参数设置为lamda函数。有人能帮忙吗?
发布于 2017-11-07 09:51:58
你就不能直接创建一个lambda吗?
.map(x -> createCategory(x, response)) https://stackoverflow.com/questions/47154597
复制相似问题