Slide 20
Slide 20 text
Processor
MethodSpec methodSpec = MethodSpec
.methodBuilder(”name”)
.addModifiers(Modifier.PUBLIC)
.returns(User.class)
.addParameter(String.class, ”name”)
.addStatement("this.$N = $N", ”name”, ”name”)
.addStatement("return this")
.build();
public UserBuilder name(String name) {
this.name = name;
return this;
}