Skip to content

Instantly share code, notes, and snippets.

@scottashipp
Last active January 3, 2019 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottashipp/c764d8160bad4889b01c34d7abc6bb71 to your computer and use it in GitHub Desktop.
Save scottashipp/c764d8160bad4889b01c34d7abc6bb71 to your computer and use it in GitHub Desktop.
Use of Mill's NullSafe class
String zipCode = NullSafe.of(user)
.call(User::addresses)
.call(UserAddresses::billingAddress)
.call(Address::zipCode)
.get();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment