是否有任何库,或者更好的 Springframework 实用程序,允许智能双向映射 A <-> B 而无需手动编写映射器?
class A {
private String xProp1;
private String xProp2;
private String yProp3;
private String yProp4;
}
class B {
private X x;
private Y y;
static class X {
private String prop1;
private String prop2;
}
static class Y {
private String prop3;
private String prop4;
}
}
最佳答案
是的,有不少:Orika , MapStruct , ModelMapper , Dozer可能还有很多其他的。
关于java - java中的智能POJO转换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49939597/