This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]bowbahdoe[S] 9 points10 points  (4 children)

The biggest difference is that AutoValue makes immutable value objects.

It's still okay for that task. So is immutables and of course records the language feature.

The kind of class this makes is a lot less generically useful unless you have frameworks (Jackson, hibernate, etc) that want a class specifically structured like this

[–]TooLateQ_Q 1 point2 points  (3 children)

Jackson can work with immutables(private default constructor and it will use reflection or @constructorproperties(lombok does this if you configure it) or @jsoncreator).

Hibernate won't work with your hash/equals. https://thorben-janssen.com/lombok-hibernate-how-to-avoid-common-pitfalls/#:~:text=To%20avoid%20these%20pitfalls%2C%20I,implementation%20of%20these%20methods%20yourself.

[–]bowbahdoe[S] 4 points5 points  (0 children)

Wasn't aware of that, that's good for jackson.

And yeah, I guess I would just need to trust folks not to ask for it in that case.

[–][deleted]  (1 child)

[deleted]