I have following code :
categoryList = Prices.stream()
.filter(price -> price.getPrice() != null)
.map(this::createCategory)
.filter(Objects::nonNull)
.collect(Collectors.toList());
And the method looks like :
private Category createCategory(PriceCategory price) {
Category category = new Category();
category.setId(price.getId());
return category;
}
I want to add a new parameter to the method createCategory - like createCategory(PriceCategory price, response)
But I don't have idea about setting this new parameter in the lambda function. Can anyone please help in this
can't you simply create a lambda instead?
.map(x -> createCategory(x, response))