This is a simple example of the builder pattern. I wrote a blog post about it: https://seism0saurus.de/design-pattern-builder.html (German)
The code is separated into two parts. The before package shows an implementation without the pattern. The after package shows the implementation with a builder. There is a simple example and one complete example with director and builder.