Optionals aren't designed for this purpose, as explained nicely by Brian Goetz.
You can always use @Nullable to denote that a method argument can be null. Using an optional does not really enable you to write your method logic more neatly.
Optionals aren't designed for this purpose, as explained nicely by Brian Goetz.
You can always use @Nullable to denote that a method argument can be null. Using an optional does not really enable you to write your method logic more neatly.