アダプターを書き込もうとしています。あるクラスから別のクラスに適応させようとしているほぼ50の属性があります。
私のコードは次のようになります:
public static Type2 getType2(Type1 type1)
{
...
if(!StringUtils.isEmpty(type1.getAttribute1()) {
type2.setAttribute1( type1.getAttribute1() );
}
// and so on for all the 50 attributes
...
}
このアダプタメソッドを作成するためのより良い方法はありますか?