import java.util.List; import lombok.Builder; @Builder(toBuilder = true) @lombok.experimental.Accessors(prefix = "m") class BuilderWithToBuilder { public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated class BuilderWithToBuilderBuilder { private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated String one; private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated String two; private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated T foo; private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated java.util.ArrayList bars; @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated BuilderWithToBuilderBuilder() { super(); } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated BuilderWithToBuilderBuilder one(final String one) { this.one = one; return this; } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated BuilderWithToBuilderBuilder two(final String two) { this.two = two; return this; } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated BuilderWithToBuilderBuilder foo(final T foo) { this.foo = foo; return this; } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated BuilderWithToBuilderBuilder bar(T bar) { if ((this.bars == null)) this.bars = new java.util.ArrayList(); this.bars.add(bar); return this; } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated BuilderWithToBuilderBuilder bars(java.util.Collection bars) { if ((this.bars == null)) this.bars = new java.util.ArrayList(); this.bars.addAll(bars); return this; } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated BuilderWithToBuilderBuilder clearBars() { if ((this.bars != null)) this.bars.clear(); return this; } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated BuilderWithToBuilder build() { java.util.List bars; switch (((this.bars == null) ? 0 : this.bars.size())) { case 0 : bars = java.util.Collections.emptyList(); break; case 1 : bars = java.util.Collections.singletonList(this.bars.get(0)); break; default : bars = java.util.Collections.unmodifiableList(new java.util.ArrayList(this.bars)); } return new BuilderWithToBuilder(one, two, foo, bars); } public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated java.lang.String toString() { return (((((((("BuilderWithToBuilder.BuilderWithToBuilderBuilder(one=" + this.one) + ", two=") + this.two) + ", foo=") + this.foo) + ", bars=") + this.bars) + ")"); } } private String mOne; private String mTwo; private @Builder.ObtainVia(method = "rrr",isStatic = true) T foo; private @lombok.Singular List bars; public static K rrr(BuilderWithToBuilder x) { return x.foo; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated BuilderWithToBuilder(final String one, final String two, final T foo, final List bars) { super(); this.mOne = one; this.mTwo = two; this.foo = foo; this.bars = bars; } public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated BuilderWithToBuilderBuilder builder() { return new BuilderWithToBuilderBuilder(); } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated BuilderWithToBuilderBuilder toBuilder() { return new BuilderWithToBuilderBuilder().one(this.mOne).two(this.mTwo).foo(BuilderWithToBuilder.rrr(this)).bars(this.bars); } } @lombok.experimental.Accessors(prefix = "m") class ConstructorWithToBuilder { public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated class ConstructorWithToBuilderBuilder { private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated String mOne; private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated T bar; @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated ConstructorWithToBuilderBuilder() { super(); } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated ConstructorWithToBuilderBuilder mOne(final String mOne) { this.mOne = mOne; return this; } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated ConstructorWithToBuilderBuilder bar(final T bar) { this.bar = bar; return this; } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated ConstructorWithToBuilder build() { return new ConstructorWithToBuilder(mOne, bar); } public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated java.lang.String toString() { return (((("ConstructorWithToBuilder.ConstructorWithToBuilderBuilder(mOne=" + this.mOne) + ", bar=") + this.bar) + ")"); } } private String mOne; private String mTwo; private T foo; private @lombok.Singular List bars; public @Builder(toBuilder = true) ConstructorWithToBuilder(String mOne, @Builder.ObtainVia(field = "foo") T bar) { super(); } public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated ConstructorWithToBuilderBuilder builder() { return new ConstructorWithToBuilderBuilder(); } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated ConstructorWithToBuilderBuilder toBuilder() { return new ConstructorWithToBuilderBuilder().mOne(this.mOne).bar(this.foo); } } @lombok.experimental.Accessors(prefix = "m") class StaticWithToBuilder { public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated class StaticWithToBuilderBuilder { private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated String mOne; private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated Z bar; @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated StaticWithToBuilderBuilder() { super(); } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated StaticWithToBuilderBuilder mOne(final String mOne) { this.mOne = mOne; return this; } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated StaticWithToBuilderBuilder bar(final Z bar) { this.bar = bar; return this; } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated StaticWithToBuilder build() { return StaticWithToBuilder.test(mOne, bar); } public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated java.lang.String toString() { return (((("StaticWithToBuilder.StaticWithToBuilderBuilder(mOne=" + this.mOne) + ", bar=") + this.bar) + ")"); } } private String mOne; private String mTwo; private T foo; private K bar; private @lombok.Singular List bars; StaticWithToBuilder() { super(); } public static @Builder(toBuilder = true) StaticWithToBuilder test(String mOne, @Builder.ObtainVia(field = "foo") Z bar) { return new StaticWithToBuilder(); } public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated StaticWithToBuilderBuilder builder() { return new StaticWithToBuilderBuilder(); } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @lombok.Generated StaticWithToBuilderBuilder toBuilder() { return new StaticWithToBuilderBuilder().mOne(this.mOne).bar(this.foo); } }