by BoyRobot777 · 5y ago · 0 comments
record Point(int x, int y) {}
Point p = new Point(1, 2); Point pp = p with { x = 3; }
[1] https://github.com/openjdk/amber-docs/blob/master/eg-drafts/...
My gut feel is that records break encapsulation and will make refactoring slightly more difficult than the equivalent lombok value class. But if this gets more people making objects immutable, I'm all for it.