This repository is the example code used in my blog article about the Type-Safe Builder pattern.
It's organized into Gradle submodules, each corresponding to a different part of the blog post. They are numbered in the order they appear in the article:
shows an example of a "classic" Builder for the
Userclass (the version with all required properties).
shows an example of a Type-Safe Builder for the
shows an example of a Type-Safe Builder for a class with optional properties
Userclass with the
displayNameproperties being optional).
- 04-jilt-builders re-implements all of the previous examples, but this time using the Jilt library instead of writing the Builders by hand.
All of this code is in the Public Domain.