我想用Lombook框架和扩展Java类,我映射。 目前我使用这个:
// @Mapper(config = BaseMapperConfig.class)
public interface MerchantsMapper {
MerchantNewDTO toNewDTO(Merchants merchant);
}
自定义实现:
public MerchantNewDTO toNewDTO(Merchants merchant)
{
MerchantNewDTO merchantNewDTO = new MerchantNewDTO();
merchantNewDTO.setId(Integer.valueOf(merchant.getId()));
......
MerchantConfigurationUtils merchant_config = new MerchantConfigurationUtils();
Map<MerchantConfigurationFeatureBitString, Boolean> features = merchant_config.initFromDatabaseValue(merchant.getSupported_features());
merchantNewDTO.setSupports_api(features.get(MerchantConfigurationFeatureBitString.Supports_api));
return merchantNewDTO;
}
正如你可以看到我想要得到getSupported_features
并填充Supports_api
值。
但是,这是非常痛苦的过程,以增加新的价值。 是否有某种方式来创建它扩展映射接口,并设置/获取值适配器?