Skip to content

Instantly share code, notes, and snippets.

@benstopford
Created November 9, 2017 00:12
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 benstopford/9969ee1e3b8a098b4f688c4000a6afbb to your computer and use it in GitHub Desktop.
Save benstopford/9969ee1e3b8a098b4f688c4000a6afbb to your computer and use it in GitHub Desktop.
orders.join(customers, Tuple::new) //join customers and orders
.filter((k, tuple) → tuple.customer.level().equals(PLATINUM) //filter platinum customers
&& tuple.order.state().equals(CONFIRMED)) //only consider confirmed orders
.peek((k, tuple) → emailer.sendMail(tuple)); //send email for each cust/order tuple
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment