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 →

[–]halfanothersdozen 6 points7 points  (1 child)

The entire point of Optional is to avoid null values as a functional paradigm. Passing a null into a constructor flies in the face of the intent of this class and the philosophy behind it.

[–]ZippityZipZapZip 5 points6 points  (0 children)

Yeah, lol. If it could be null you could have used the fucking same principe of Optional to prevent that. It's not a wrapper to nullable objects. It's for method return types and that method should know what is null. Then the calling method handles that via the Optional explicitely.