Skip to content

Instantly share code, notes, and snippets.

@gszeliga
Created July 16, 2015 21:10
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 gszeliga/9fa41295a2c5865524e7 to your computer and use it in GitHub Desktop.
Save gszeliga/9fa41295a2c5865524e7 to your computer and use it in GitHub Desktop.
Outcome<TariffStructure> tariff =
maybe(ctx.getTariffStructureService()
.flatMap(ts -> ts.get(ctx.getPrices().getTariffId())))
.orIfEmpty(() -> fail(format("Tariff structure with id '%d' could not be found", ctx.getPrices().getTariffId())));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment