新聞中心
這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
DozerMapper:對(duì)象轉(zhuǎn)換器使用教程-創(chuàng)新互聯(lián)
dozer GitHub地址:https://github.com/DozerMapper/dozer
官方wiki:Introduction · GitBook
第一步:導(dǎo)包com.github.dozermapper dozer-core 6.5.2
第二步:配置轉(zhuǎn)換器
DozerConfig.java文件package com.ymf.invoice.config;
import com.github.dozermapper.core.DozerBeanMapperBuilder;
import com.github.dozermapper.core.Mapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.Arrays;
import java.util.List;
@Configuration
public class DozerConfig {@Bean
public Mapper dozerBeanMapper() {ListmappingFiles = Arrays.asList(
"dozer-configration-mapping.xml"
);
return DozerBeanMapperBuilder.create()
.withMappingFiles(mappingFiles)
.build();
}
}
dozer-configration-mapping.xml文件
第三步:簡(jiǎn)單測(cè)試import com.github.dozermapper.core.Mapper;
@Autowired
private Mapper mapper;
InvoiceTaskDto invoiceTaskDto = mapper.map(invoiceTask, InvoiceTaskDto.class);
你是否還在尋找穩(wěn)定的海外服務(wù)器提供商?創(chuàng)新互聯(lián)www.cdcxhl.cn海外機(jī)房具備T級(jí)流量清洗系統(tǒng)配攻擊溯源,準(zhǔn)確流量調(diào)度確保服務(wù)器高可用性,企業(yè)級(jí)服務(wù)器適合批量采購(gòu),新人活動(dòng)首月15元起,快前往官網(wǎng)查看詳情吧
分享名稱:DozerMapper:對(duì)象轉(zhuǎn)換器使用教程-創(chuàng)新互聯(lián)
文章網(wǎng)址:http://www.dlmjj.cn/article/shgec.html