Open leavestylecode opened 3 years ago
Can you give an example what you are trying to achieve? How would the final POJO look like? Currently, there is no lombok-support planned.
Sometimes we obtain model
from db, we want to change some params value of this. From the characteristics of functional programming, we hope that objects have immutability and no side effects. So I often use @With @builder(toBuilder = true) of Lombok
.
When I change a value of model. Such as change name, I will....
var newModel = model.withName(newName);
When I change multi values of model. Such as change name、address、profession, I will....
var newModel = model.toBuilder.name(newName).address(newAddress).profession(newProfession).build();
return a new model. I don't worry about data conflicts or data being overwritten.
I hope generated pojos can support @With @Builder(toBuilder = true).
Create an immutable object & edit pojos can be more functional.