Last active
March 3, 2017 21:53
-
-
Save mstepien/109e569381293628ec861d0c34aaf8d0 to your computer and use it in GitHub Desktop.
Decorator Pattern done with function composition
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Coffee coffee = Barista.makeCoffee( | |
new Arabica(), | |
Coffee::withMilk, | |
Coffee::withSprinkles); | |
System.out.println( | |
coffee.getIngredients() | |
+ ". Cost: "+ | |
coffee.getCost()); | |
//https://github.com/mstepien/functional-java-patterns/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment