I am new to Java 8 Lambda, so I may not be familiar with the correct terminology. Please point me in the right direction and I will make the necessary changes in my question. So here it is:
I have written a java lambda function that does a lot of manipulations, however I am struggling with just one bit.
Code:
final List<JsonNode> curatedArticles = chubRelatedVideoArticles.stream()
.filter(this::isValidRelatedVideoArticle)
.filter(this::dedupeOGArticle)
.map(this::convertChubRelatedVideosIntoMcsRelatedVideos)
.collect(Collectors.toList());
Now for all the functions used above it is fine to not pass the param, e.g. as it uses "this". So the function signature is:
private boolean isValidRelatedVideoArticle(final ChubRelatedVideoArticle article)
Now, I would like to pass a string to the dedupeOGArticle along with the "final ChubRelatedVideoArticle article" as well.
Thanks in advance.
Use a lambda:
.filter(article -> this.dedupeOGArticle(article, "some string"))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With