Skip to content

Instantly share code, notes, and snippets.

@mhtmalpani
Created November 26, 2017 19:27
Show Gist options
  • Save mhtmalpani/14061c0e49ab2abaef76c10a910b34f5 to your computer and use it in GitHub Desktop.
Save mhtmalpani/14061c0e49ab2abaef76c10a910b34f5 to your computer and use it in GitHub Desktop.
The helper interfaces for Builder pattern with Twist
public interface Bread {
Toast bread(String bread);
}
public interface Toast {
Type toast(boolean toast);
}
public interface Type {
Veg veg();
NonVeg nonVeg();
}
public interface NonVeg {
Veg chicken();
Veg mutton();
}
public interface Veg {
Veg onion();
Veg tomato();
Veg olives();
Extra prepare();
}
public interface Extra {
Extra cheese(String cheese);
Subway build();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment