So we now have explicit optional to go with implicit optional. Still looking for an explicit not-optional where the compiler will complain when a possibly-null value is passed in :(
Edit: @NonNull rather than @NotNull. This annotation has existed in various guises and frameworks for a while, usually as @NotNull which is is probably why it's called @NonNull (avoiding breaking changes)
3 comments
[ 2.2 ms ] story [ 15.1 ms ] threadhttps://blogs.oracle.com/java-platform-group/entry/java_8_s_...
Edit: @NonNull rather than @NotNull. This annotation has existed in various guises and frameworks for a while, usually as @NotNull which is is probably why it's called @NonNull (avoiding breaking changes)
The difference being, of course, that having an Optional type forces you to check if it's null or not before getting at the underlying object.