diff options
author | Jan Rieke <it@janrieke.de> | 2018-09-11 20:37:16 +0200 |
---|---|---|
committer | Jan Rieke <it@janrieke.de> | 2018-09-11 20:44:19 +0200 |
commit | a2b884c71194c780d37ccbd84561abd6a0f63741 (patch) | |
tree | 53c91b1c713c8db0523999bb28592ef8f40d7e08 /test/transform/resource/after-ecj | |
parent | da59d2d6375afcfcf6cb43288adba61cb99a49e8 (diff) | |
download | lombok-a2b884c71194c780d37ccbd84561abd6a0f63741.tar.gz lombok-a2b884c71194c780d37ccbd84561abd6a0f63741.tar.bz2 lombok-a2b884c71194c780d37ccbd84561abd6a0f63741.zip |
SuperBuilder: fixed ObtainVia
Diffstat (limited to 'test/transform/resource/after-ecj')
-rw-r--r-- | test/transform/resource/after-ecj/SuperBuilderBasicToBuilder.java | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/test/transform/resource/after-ecj/SuperBuilderBasicToBuilder.java b/test/transform/resource/after-ecj/SuperBuilderBasicToBuilder.java index 2b294d65..974d933d 100644 --- a/test/transform/resource/after-ecj/SuperBuilderBasicToBuilder.java +++ b/test/transform/resource/after-ecj/SuperBuilderBasicToBuilder.java @@ -1,15 +1,20 @@ import java.util.List;
-
public class SuperBuilderBasicToBuilder {
public static @lombok.experimental.SuperBuilder(toBuilder = true) class Parent {
public static abstract @java.lang.SuppressWarnings("all") class ParentBuilder<C extends Parent, B extends ParentBuilder<C, B>> {
private @java.lang.SuppressWarnings("all") int field1;
+ private @java.lang.SuppressWarnings("all") int obtainViaField;
+ private @java.lang.SuppressWarnings("all") int obtainViaMethod;
+ private @java.lang.SuppressWarnings("all") String obtainViaStaticMethod;
private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> items;
public ParentBuilder() {
super();
}
protected @java.lang.SuppressWarnings("all") B $fillValuesFrom(final C instance) {
field1(instance.field1);
+ obtainViaField(instance.field1);
+ obtainViaMethod(instance.method());
+ obtainViaStaticMethod(Parent.staticMethod(instance));
items(((instance.items == null) ? java.util.Collections.emptyList() : instance.items));
return self();
}
@@ -19,6 +24,18 @@ public class SuperBuilderBasicToBuilder { this.field1 = field1;
return self();
}
+ public @java.lang.SuppressWarnings("all") B obtainViaField(final int obtainViaField) {
+ this.obtainViaField = obtainViaField;
+ return self();
+ }
+ public @java.lang.SuppressWarnings("all") B obtainViaMethod(final int obtainViaMethod) {
+ this.obtainViaMethod = obtainViaMethod;
+ return self();
+ }
+ public @java.lang.SuppressWarnings("all") B obtainViaStaticMethod(final String obtainViaStaticMethod) {
+ this.obtainViaStaticMethod = obtainViaStaticMethod;
+ return self();
+ }
public @java.lang.SuppressWarnings("all") B item(String item) {
if ((this.items == null))
this.items = new java.util.ArrayList<String>();
@@ -37,7 +54,7 @@ public class SuperBuilderBasicToBuilder { return self();
}
public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
- return (((("SuperBuilderBasicToBuilder.Parent.ParentBuilder(field1=" + this.field1) + ", items=") + this.items) + ")");
+ return (((((((((("SuperBuilderBasicToBuilder.Parent.ParentBuilder(field1=" + this.field1) + ", obtainViaField=") + this.obtainViaField) + ", obtainViaMethod=") + this.obtainViaMethod) + ", obtainViaStaticMethod=") + this.obtainViaStaticMethod) + ", items=") + this.items) + ")");
}
}
private static final @java.lang.SuppressWarnings("all") class ParentBuilderImpl extends ParentBuilder<Parent, ParentBuilderImpl> {
@@ -52,10 +69,22 @@ public class SuperBuilderBasicToBuilder { }
}
int field1;
+ @lombok.Builder.ObtainVia(field = "field1") int obtainViaField;
+ @lombok.Builder.ObtainVia(method = "method") int obtainViaMethod;
+ @lombok.Builder.ObtainVia(method = "staticMethod",isStatic = true) String obtainViaStaticMethod;
@lombok.Singular List<String> items;
+ int method() {
+ return 2;
+ }
+ private static String staticMethod(Parent instance) {
+ return "staticMethod";
+ }
protected @java.lang.SuppressWarnings("all") Parent(final ParentBuilder<?, ?> b) {
super();
this.field1 = b.field1;
+ this.obtainViaField = b.obtainViaField;
+ this.obtainViaMethod = b.obtainViaMethod;
+ this.obtainViaStaticMethod = b.obtainViaStaticMethod;
java.util.List<String> items;
switch (((b.items == null) ? 0 : b.items.size())) {
case 0 :
|