Hacker News new | ask | show | jobs
by atinoda-kestrel 4002 days ago
> What's the advantage of that as opposed to the 'standard' java way of doing immutable via 'final'?

They're not really comparable.

This is code generation for builders, getters, etc. The idea is that you write less of the boilerplate that you'd write if you were rolling your own immutable POJOs.

Plus, unless I'm mis-reading the docs, it also handles certain collection types transparently. (Which obviously just throwing final on a property won't do.)

1 comments

My IDE (IntelliJ) does a lot of the writing of immutable POJOs for me :). The builders are a bit different for sure, but I don't see what's wrong with having an object that is only "mutable" in the construction phase.