私は2つのポジョを持っています。
public class Pojo1 implements Serializable {
private static final long serialVersionUID = 1302290920579795856L;
private Long id;
private String idNumber;
private String vendorNumber;
private Date expires;
// Getters and setters for each one
}
public class Pojo2 implements Serializable {
private static final long serialVersionUID = 1302290920579795856L;
private Long id;
private String idNumber;
private String vendorNumber;
private Date expires;
private String otherData;
// Getters and setters for each one
}
Pojo2 から Pojo1 を自動的に作成するために使用できる Java API はありますか?
すなわち:
Pojo1 newPojo1 = SomeLibrary.fromPojoWithLikeNamedFields(pojo2);
// newPojo1 now has all the fields that had the same name from pojo2