一、数据转换图例
二、源实体类
@Data
public class SourceDO implements Serializable {
private String firTitle;
private Long secTitle;
private String thiTitle;
}
三、目标实体类父类
@Data
public class TargetDTO implements Serializable {
private String firTitle;
private List<TargetSonDTO> secTitleList;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TargetDTO tcdto = (TargetDTO) o;
return Objects.equals(firTitle, tcdto.firTitle);
}
}