re: Builder Design Pattern VIEW POST


I prefer Java 8 style builders

Burger.of(14, ingredients -> ingredients

You can easily create an overload which accepts only the mandatory arguments


The configuration is implemented as a Consumer of type T, where T is a some sort of configuration object.

See Molten JSON for a JSON Builder implemented that way.

code of conduct - report abuse