Java中的设计模式 - Builder
- 定义
@Value
@Builder
public class Xxx {
Yyy1 yyy1;
Yyy2 yyy2;
- 使用
xxx.builder().Yyy1(yyy1).Yyy2(yyy2).build();
@Value
@Builder
public class Xxx {
Yyy1 yyy1;
Yyy2 yyy2;
xxx.builder().Yyy1(yyy1).Yyy2(yyy2).build();