Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Deprecating: java.util.Optional.get()?. Parent comment
b) get() is useful and less verbose for cases where other logic has proven that the get() will succeed.
boolean allPresent = a.isPresent() && b.isPresent() if (allPresent){ doSomething(a.get()) }
There are no comments on this comment yet.
b) get() is useful and less verbose for cases where other logic has proven that the get() will succeed.
edit: just noticed this example is the same idea merb posted earlier.