@Data
@Builder
public class Demo {
@Tolerate
public Demo(){
}
private int type = 2;
private String url;
}
通过builder模式,如果不设置type,还指望它能够设置2,恐怕要令你失望了。
告警
1
Warning:(95, 30) java: @Builder will ignore the initializing expression entirely. If you want the initializing expression to serve as default, add @Builder.Default. if it is not supposed to be settable during building, add @Builder.Constant.