I want to set value to a field of an object so that it will first get the previous value of that field and append something to it and the set it to that field.
In LambdaJ forEach
we can do something like this:
forEach(myCollection).setFieldValue("someValue");
But what I need is:
forEach(myCollection).setFieldValue(getFieldValue() + "someValue");
Is it possible in LambdaJ?
I know you asked about LambdaJ, I was curious to do that since it is a common problem.
I was surprised of the result I got doing:
I though it would be the answer to your question.
So, I tried a different approach by using Guava functional way. It can work for you so I'll post the answer (but I can delete it if you don't agree with it):
Guava functional approach:
Hope to help