aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource/before/SuperBuilderWithCustomBuilderMethod.java
blob: b828eafeecbf7c4b93e070c6873c4b3931fd9568 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//version 8: Javac 6 will error out due to `ChildBuilder` not existing before properly running lombok. Giving j6 support status, not worth fixing.
import java.util.List;

public class SuperBuilderWithCustomBuilderMethod {
	@lombok.experimental.SuperBuilder
	public static class Parent<A> {
		A field1;
		@lombok.Singular List<String> items;
	}
	
	@lombok.experimental.SuperBuilder
	public static class Child<A> extends Parent<A> {
		double field3;
		public static <A> ChildBuilder<A, ?, ?> builder() {
			return new ChildBuilderImpl<A>().item("default item");
		}
	}
	
	public static void test() {
		Child<Integer> x = Child.<Integer>builder().field3(0.0).field1(5).item("").build();
	}
}