Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Java Without If. Parent comment
If a function could return either T or null, return Optional<T>, and then use Optional::flatMap to join them together.
Pretty straightforward.
There are no comments on this comment yet.
If a function could return either T or null, return Optional<T>, and then use Optional::flatMap to join them together.
Pretty straightforward.