实施PARAMS龙目岛的映射转换后(Implement params convert after l

2019-10-29 06:59发布

我想用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值。

但是,这是非常痛苦的过程,以增加新的价值。 是否有某种方式来创建它扩展映射接口,并设置/获取值适配器?

文章来源: Implement params convert after lombok mapping