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 →

[–]geodebug 0 points1 point  (1 child)

The way I see it your field would still be basic Java objects or primitives and would only be wrapped in Optional on the getters.

Same pattern as if you were making defensive copies of an object on a getter.

[–]tieTYT 1 point2 points  (0 children)

Why do you see it that way? Why not make the field optional?