How do I initialize classes with lots of fields in an elegant way?

后端 未结 6 1184
伪装坚强ぢ
伪装坚强ぢ 2020-12-23 11:40

In my application, I have to instantiate many different types of objects. Each type contains some fields and needs to be added to a containing type. How can I do this in an

6条回答
  •  甜味超标
    2020-12-23 12:32

    Dozer framework provides nice way to do copy values from ws object to your dto. Here is another example. Additionally if the getter/setter names are the same of both class you dont need custom converter

提交回复
热议问题