Skip to content

Instantly share code, notes, and snippets.

@adamv
Last active May 30, 2019 22:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamv/ef441839cfa94373d1875a4babce9cc1 to your computer and use it in GitHub Desktop.
Save adamv/ef441839cfa94373d1875a4babce9cc1 to your computer and use it in GitHub Desktop.
When did this:
Optional.ofNullable(value)
.map(MyType::getProp)
.map(x -> x.equals(MyEnum.VALUE))
.orElse(Boolean.FALSE)
get sexier than this:
value != null && MyEnum.VALUE.equals(value.getProp())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment