diff options
author | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2019-12-11 00:28:37 +0100 |
---|---|---|
committer | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2019-12-11 00:28:37 +0100 |
commit | 6bab046832d9bb9bfea67a1503917a2551687453 (patch) | |
tree | 0da758f7096cbab779f2dd7d3a03d3ebc0422621 /src/core/lombok/Builder.java | |
parent | ea01e1c3199340b7e16ff75f63688eae0ca91c4b (diff) | |
parent | b7e42d13ea98e280914f09f91fc03f355ea9682b (diff) | |
download | lombok-6bab046832d9bb9bfea67a1503917a2551687453.tar.gz lombok-6bab046832d9bb9bfea67a1503917a2551687453.tar.bz2 lombok-6bab046832d9bb9bfea67a1503917a2551687453.zip |
Merge branch 'feature/builder-setter-prefixes' of git://github.com/floralvikings/lombok into floralvikings-feature/builder-setter-prefixes
Diffstat (limited to 'src/core/lombok/Builder.java')
-rw-r--r-- | src/core/lombok/Builder.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/core/lombok/Builder.java b/src/core/lombok/Builder.java index dfa5ecb5..fcbe1a09 100644 --- a/src/core/lombok/Builder.java +++ b/src/core/lombok/Builder.java @@ -153,6 +153,19 @@ public @interface Builder { * @return The builder class will be generated with this access modifier. */ AccessLevel access() default lombok.AccessLevel.PUBLIC; + + /** + * Prefix to prepend to set methods in the generated builder class. By default, generated methods to not include a + * prefix. If this value populated, the first letter of the generated method name will be capitalized. + * + * For example, a method normally generated as {@code someField(String someField)} would instead be generated as {@code withSomeField(String someField)} + * + * Note that using "with" to prefix builder setter methods is strongly discouraged as as "with" normally + * suggests immutable data structures, and builders by definition are mutable objects. + * + * @return The prefix to prepend to generated method names. + */ + String setterPrefix() default ""; /** * Put on a field (in case of {@code @Builder} on a type) or a parameter (for {@code @Builder} on a constructor or static method) to |