mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-15 02:17:12 +00:00
[fixes #2046] you can now suppress the builder() method, useful if you only want toBuilder(). Also suppresses the warnings about any missing Builder.Default annotations.
This commit is contained in:
1 parent
535e20972c
commit
228e99fe52
8 files changed
+118
-7
No files matched your search
@@ -0,0 +1,33 @@
|
||||
class BuilderWithNoBuilderMethod {
|
||||
private String a = "";
|
||||
@java.lang.SuppressWarnings("all")
|
||||
BuilderWithNoBuilderMethod(final String a) {
|
||||
this.a = a;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
public static class BuilderWithNoBuilderMethodBuilder {
|
||||
@java.lang.SuppressWarnings("all")
|
||||
private String a;
|
||||
@java.lang.SuppressWarnings("all")
|
||||
BuilderWithNoBuilderMethodBuilder() {
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
public BuilderWithNoBuilderMethodBuilder a(final String a) {
|
||||
this.a = a;
|
||||
return this;
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
public BuilderWithNoBuilderMethod build() {
|
||||
return new BuilderWithNoBuilderMethod(a);
|
||||
}
|
||||
@java.lang.Override
|
||||
@java.lang.SuppressWarnings("all")
|
||||
public java.lang.String toString() {
|
||||
return "BuilderWithNoBuilderMethod.BuilderWithNoBuilderMethodBuilder(a=" + this.a + ")";
|
||||
}
|
||||
}
|
||||
@java.lang.SuppressWarnings("all")
|
||||
public BuilderWithNoBuilderMethodBuilder toBuilder() {
|
||||
return new BuilderWithNoBuilderMethodBuilder().a(this.a);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user