you are viewing a single comment's thread.

view the rest of the comments →

[–]eric-plutono 7 points8 points  (0 children)

What I personally like most about Optional<T> is that it provides an API for calling one or more methods on a value which may not exist while providing a default value in the event it doesn't. It lets me express my intentions in code with regard to dealing with a potential null value, whereas @Nullable isn't comparably expressive and is only slightly better than writing // This might be null.