builder pattern
Building a complicated value step by step with chained method calls, then finishing it.
A builder collects optional settings through chained methods and validates them in a final build() call, avoiding constructors with many parameters.
Examples
OpenOptions::new().create(true).append(true).open("loans.txt")sets options one call at a time, thenopenfinishes the value.
See also