# Package groovy.transform.builder

## Package groovy.transform.builder Description

Builder pattern generation via AST transformation.

@Builder annotation with pluggable strategies: SimpleStrategy (chained setters), DefaultStrategy (nested helper), InitializerStrategy (type-safe), ExternalStrategy (separate class).

- Class Summary
  Class | Description
  --- | ---
  BuilderASTStubber | Joint-compilation stubber for Builder, covering the two most common shapes: DefaultStrategy on a class-level annotation: emits the inner builder class with fluent setters and a `build()` method, plus a static `Foo.builder()` factory on the buildee.
  DefaultStrategy | This strategy is used with the Builder AST transform to create a builder helper class for the fluent creation of instances of a specified class.
  ExternalStrategy | This strategy is used with the Builder AST transform to populate a builder helper class so that it can be used for the fluent creation of instances of a specified class.
  InitializerStrategy | This strategy is used with the Builder AST transform to create a builder helper class for the fluent and type-safe creation of instances of a specified class.
  InitializerStrategy.SET | Internal phantom type used by the `InitializerStrategy` to indicate that a property has been set.
  InitializerStrategy.UNSET | Internal phantom type used by the `InitializerStrategy` to indicate that a property remains unset.
  SimpleStrategy | This strategy is used with the Builder AST transform to modify your Groovy objects so that the setter methods for properties return the original object, thus allowing chained usage of the setters.

- Annotation Type Summary
  Annotation Type | Description
  --- | ---
  Builder | The `@Builder` AST transformation is used to help write classes that can be created using fluent api calls.