From 48b1f17f7ef0e0b3d90dee74ee1b490a02cacff2 Mon Sep 17 00:00:00 2001 From: Jan Rieke Date: Fri, 1 May 2020 23:56:17 +0200 Subject: [SuperBuilder] allow constructor customization --- test/transform/resource/before/SuperBuilderCustomized.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/transform/resource/before/SuperBuilderCustomized.java') diff --git a/test/transform/resource/before/SuperBuilderCustomized.java b/test/transform/resource/before/SuperBuilderCustomized.java index 77830587..8e641d90 100644 --- a/test/transform/resource/before/SuperBuilderCustomized.java +++ b/test/transform/resource/before/SuperBuilderCustomized.java @@ -14,6 +14,16 @@ public class SuperBuilderCustomized { } } int field1; + + protected Parent(ParentBuilder b) { + if (b.field1 == 0) + throw new IllegalArgumentException("field1 must be != 0"); + this.field1 = b.field1; + } + + public static SuperBuilderCustomized.Parent.ParentBuilder builder(int field1) { + return new SuperBuilderCustomized.Parent.ParentBuilderImpl().field1(field1); + } } @lombok.experimental.SuperBuilder -- cgit