@Documented
@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface EnhancedBuilder
EnhancedBuilder extends ExternalStrategy
with the following:
The @EnhancedBuilder annotation must be added to the Builder Class along with the @
Builder
annotation.
To indicate the prebuild hook, annotate the no-arg constructor with @Prebuild
@Builder(builderStrategy = ExternalStrategy, prefix = "with", forClass = ClassToBuild) @EnhancedBuilder private static class ClassToBuildBuilder { List <String> addressLines = [] @Prebuild void makeCollectionsImmutable() { this.addressLines = ImmutableList.copyOf(this.addressLines) } }
Modifier and Type | Optional Element and Description |
---|---|
EnhancedBuilder.TrimMode |
trimStrings |
public abstract EnhancedBuilder.TrimMode trimStrings