Created
November 26, 2017 19:36
-
-
Save mhtmalpani/d76ffbc79b28aecacd5fd394bc318eef to your computer and use it in GitHub Desktop.
The Client code for Builder with Twist.
This file contains 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
public class Main { | |
public static void main(String[] args) { | |
Subway subwayVegetarian = Subway.builder().bread("Wheat") | |
.toast(true) | |
.veg() | |
.olives().tomato().onion() | |
.prepare() | |
.cheese("Mozzarella") | |
.build(); | |
Subway subwayNonVegChicken = Subway.builder().bread("Parmesan Oregano") | |
.toast(false) | |
.nonVeg() | |
.chicken() | |
.olives().tomato() | |
.prepare() | |
.cheese("Cheddar") | |
.build(); | |
Subway subwayNonVegMutton = Subway.builder().bread("Italian White") | |
.toast(true) | |
.nonVeg() | |
.mutton() | |
.tomato().onion() | |
.prepare() | |
.build(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment