Skip to content

Instantly share code, notes, and snippets.

@Francesco-itembase
Created June 29, 2020 11:16
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 Francesco-itembase/fa3add74beb2b4e23b5e3cb14941810a to your computer and use it in GitHub Desktop.
Save Francesco-itembase/fa3add74beb2b4e23b5e3cb14941810a to your computer and use it in GitHub Desktop.
Trivial examples
Long itemId = 42L;
BigDecimal vatRate = BigDecimal.of(0.42);
// error handling is omitted for brevity
return fetchItem(itemId)
.flatmap(item -> calculateTax(item, vatRate))
.flatmap(BusinessClass::writeTaxToDB);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment