private MethodSpec build() { return MethodSpec.methodBuilder("build") .addModifiers(Modifier.PUBLIC, Modifier.ABSTRACT) .returns(builder.naming().superClassTypeNameUnbounded()) .build(); }
private MethodSpec build() { return MethodSpec.methodBuilder("build") .addModifiers(Modifier.PUBLIC, Modifier.ABSTRACT) .returns(builder.naming().superClassTypeNameUnbounded()) .build(); }
private MethodSpec build(List<BuilderClassConstructor> constructorList) { MethodSpec.Builder b = MethodSpec.methodBuilder("build") .addAnnotation(Override.class) .addModifiers(Modifier.PUBLIC) .returns(builder.naming().superClassTypeNameUnbounded()); AtomicInteger index = new AtomicInteger(); List<CodeBlock> codeBlockList = constructorList.stream() .map(constructor -> constructor.build(builder.naming(), index.getAndIncrement())) .collect(Collectors.toList()); for (CodeBlock codeBlock : codeBlockList) { b.addCode(codeBlock); } return b.build(); }
private MethodSpec build(List<BuilderClassConstructor> constructorList) { MethodSpec.Builder b = MethodSpec.methodBuilder("build") .addAnnotation(Override.class) .addModifiers(Modifier.PUBLIC) .returns(builder.naming().superClassTypeNameUnbounded()); AtomicInteger index = new AtomicInteger(); List<CodeBlock> codeBlockList = constructorList.stream() .map(constructor -> constructor.build(builder.naming(), index.getAndIncrement())) .collect(Collectors.toList()); for (CodeBlock codeBlock : codeBlockList) { b.addCode(codeBlock); } return b.build(); }