原型模式
简介
代码示例
@Data
public class UserPrototype implements Cloneable {
private Integer id;
private String name;
private String desc;
public UserPrototype() {
System.out.println("创建对象成功...");
}
@Override
public Object clone() throws CloneNotSupportedException {
return super.clone();
}
}Last updated