1.MapStruct是用來(lái)做什么的?
現(xiàn)在有這么個(gè)場(chǎng)景,從數(shù)據(jù)庫(kù)查詢(xún)出來(lái)了一個(gè)user對(duì)象(包含id,用戶(hù)名,密碼,手機(jī)號(hào),郵箱,角色這些字段)和一個(gè)對(duì)應(yīng)的角色對(duì)象role(包含id,角色名,角色描述這些字段),現(xiàn)在在controller需要用到user對(duì)象的id,用戶(hù)名,和角色對(duì)象的角色名三個(gè)屬性。
一種方式是直接把兩個(gè)對(duì)象傳遞到controller層,但是這樣會(huì)多出很多沒(méi)用的屬性。更通用的方式是需要用到的屬性封裝成一個(gè)類(lèi)(DTO),通過(guò)傳輸這個(gè)類(lèi)的實(shí)例來(lái)完成數(shù)據(jù)傳輸。
User.java
@AllArgsConstructor
@Data
publicclassUser{
privateLongid;
privateStringusername;
privateStringpassword;
privateStringphoneNum;
privateStringemail;
privateRolerole;
}
Role.java
@AllArgsConstructor
@Data
publicclassRole{
privateLongid;
privateStringroleName;
privateStringdescription;
}
UserRoleDto.java,這個(gè)類(lèi)就是封裝的類(lèi)
@Data
publicclassUserRoleDto{
/**
*用戶(hù)id
*/
privateLonguserId;
/**
*用戶(hù)名
*/
privateStringname;
/**
*角色名
*/
privateStringroleName;
}
測(cè)試類(lèi),模擬將user對(duì)象轉(zhuǎn)換成UserRoleDto對(duì)象
publicclassMainTest{
Useruser=null;
/**
*模擬從數(shù)據(jù)庫(kù)中查出user對(duì)象
*/
@Before
publicvoidbefore(){
Rolerole=newRole(2L,"administrator","超級(jí)管理員");
user=newUser(1L,"zhangsan","12345","17677778888","123@qq.com",role);
}
/**
*模擬把user對(duì)象轉(zhuǎn)換成UserRoleDto對(duì)象
*/
@Test
publicvoidtest1(){
UserRoleDtouserRoleDto=newUserRoleDto();
userRoleDto.setUserId(user.getId());
userRoleDto.setName(user.getUsername());
userRoleDto.setRoleName(user.getRole().getRoleName());
System.out.println(userRoleDto);
}
}
從上面代碼可以看出,通過(guò)getter、setter的方式把一個(gè)對(duì)象屬性值復(fù)制到另一個(gè)對(duì)象中去還是很麻煩的,尤其是當(dāng)屬性過(guò)多的時(shí)候。而MapStruct就是用于解決這種問(wèn)題的。
2.使用MapStruct解決上述問(wèn)題
這里我們沿用User.java、Role.java、UserRoleDto.java。
新建一個(gè)UserRoleMapper.java,這個(gè)來(lái)用來(lái)定義User.java、Role.java和UserRoleDto.java之間屬性對(duì)應(yīng)規(guī)則:
UserRoleMapper.java
importorg.mapstruct.Mapper;
importorg.mapstruct.Mapping;
importorg.mapstruct.Mappings;
importorg.mapstruct.factory.Mappers;
/**
*@Mapper定義這是一個(gè)MapStruct對(duì)象屬性轉(zhuǎn)換接口,在這個(gè)類(lèi)里面規(guī)定轉(zhuǎn)換規(guī)則
*在項(xiàng)目構(gòu)建時(shí),會(huì)自動(dòng)生成改接口的實(shí)現(xiàn)類(lèi),這個(gè)實(shí)現(xiàn)類(lèi)將實(shí)現(xiàn)對(duì)象屬性值復(fù)制
*/
@Mapper
publicinterfaceUserRoleMapper{
/**
*獲取該類(lèi)自動(dòng)生成的實(shí)現(xiàn)類(lèi)的實(shí)例
*接口中的屬性都是publicstaticfinal的方法都是publicabstract的
*/
UserRoleMapperINSTANCES=Mappers.getMapper(UserRoleMapper.class);
/**
*這個(gè)方法就是用于實(shí)現(xiàn)對(duì)象屬性復(fù)制的方法
*
*@Mapping用來(lái)定義屬性復(fù)制規(guī)則source指定源對(duì)象屬性target指定目標(biāo)對(duì)象屬性
*
*@paramuser這個(gè)參數(shù)就是源對(duì)象,也就是需要被復(fù)制的對(duì)象
*@return返回的是目標(biāo)對(duì)象,就是最終的結(jié)果對(duì)象
*/
@Mappings({
@Mapping(source="id",target="userId"),
@Mapping(source="username",target="name"),
@Mapping(source="role.roleName",target="roleName")
})
UserRoleDtotoUserRoleDto(Useruser);
}
在測(cè)試類(lèi)中測(cè)試:
通過(guò)上面的例子可以看出,使用MapStruct方便許多。
3.添加默認(rèn)方法
添加默認(rèn)方法是為了這個(gè)類(lèi)(接口)不只是為了做數(shù)據(jù)轉(zhuǎn)換用的,也可以做一些其他的事。
importorg.mapstruct.Mapper;
importorg.mapstruct.Mapping;
importorg.mapstruct.Mappings;
importorg.mapstruct.factory.Mappers;
/**
*@Mapper定義這是一個(gè)MapStruct對(duì)象屬性轉(zhuǎn)換接口,在這個(gè)類(lèi)里面規(guī)定轉(zhuǎn)換規(guī)則
*在項(xiàng)目構(gòu)建時(shí),會(huì)自動(dòng)生成改接口的實(shí)現(xiàn)類(lèi),這個(gè)實(shí)現(xiàn)類(lèi)將實(shí)現(xiàn)對(duì)象屬性值復(fù)制
*/
@Mapper
publicinterfaceUserRoleMapper{
/**
*獲取該類(lèi)自動(dòng)生成的實(shí)現(xiàn)類(lèi)的實(shí)例
*接口中的屬性都是publicstaticfinal的方法都是publicabstract的
*/
UserRoleMapperINSTANCES=Mappers.getMapper(UserRoleMapper.class);
/**
*這個(gè)方法就是用于實(shí)現(xiàn)對(duì)象屬性復(fù)制的方法
*
*@Mapping用來(lái)定義屬性復(fù)制規(guī)則source指定源對(duì)象屬性target指定目標(biāo)對(duì)象屬性
*
*@paramuser這個(gè)參數(shù)就是源對(duì)象,也就是需要被復(fù)制的對(duì)象
*@return返回的是目標(biāo)對(duì)象,就是最終的結(jié)果對(duì)象
*/
@Mappings({
@Mapping(source="id",target="userId"),
@Mapping(source="username",target="name"),
@Mapping(source="role.roleName",target="roleName")
})
UserRoleDtotoUserRoleDto(Useruser);
/**
*提供默認(rèn)方法,方法自己定義,這個(gè)方法是我隨便寫(xiě)的,不是要按照這個(gè)格式來(lái)的
*@return
*/
defaultUserRoleDtodefaultConvert(){
UserRoleDtouserRoleDto=newUserRoleDto();
userRoleDto.setUserId(0L);
userRoleDto.setName("None");
userRoleDto.setRoleName("None");
returnuserRoleDto;
}
}
測(cè)試代碼:
@Test
publicvoidtest3(){
UserRoleMapperuserRoleMapperInstances=UserRoleMapper.INSTANCES;
UserRoleDtouserRoleDto=userRoleMapperInstances.defaultConvert();
System.out.println(userRoleDto);
}
4. 可以使用abstract class來(lái)代替接口
mapper可以用接口來(lái)實(shí)現(xiàn),也可以完全由抽象來(lái)完全代替
importorg.mapstruct.Mapper;
importorg.mapstruct.Mapping;
importorg.mapstruct.Mappings;
importorg.mapstruct.factory.Mappers;
/**
*@Mapper定義這是一個(gè)MapStruct對(duì)象屬性轉(zhuǎn)換接口,在這個(gè)類(lèi)里面規(guī)定轉(zhuǎn)換規(guī)則
*在項(xiàng)目構(gòu)建時(shí),會(huì)自動(dòng)生成改接口的實(shí)現(xiàn)類(lèi),這個(gè)實(shí)現(xiàn)類(lèi)將實(shí)現(xiàn)對(duì)象屬性值復(fù)制
*/
@Mapper
publicabstractclassUserRoleMapper{
/**
*獲取該類(lèi)自動(dòng)生成的實(shí)現(xiàn)類(lèi)的實(shí)例
*接口中的屬性都是publicstaticfinal的方法都是publicabstract的
*/
publicstaticfinalUserRoleMapperINSTANCES=Mappers.getMapper(UserRoleMapper.class);
/**
*這個(gè)方法就是用于實(shí)現(xiàn)對(duì)象屬性復(fù)制的方法
*
*@Mapping用來(lái)定義屬性復(fù)制規(guī)則source指定源對(duì)象屬性target指定目標(biāo)對(duì)象屬性
*
*@paramuser這個(gè)參數(shù)就是源對(duì)象,也就是需要被復(fù)制的對(duì)象
*@return返回的是目標(biāo)對(duì)象,就是最終的結(jié)果對(duì)象
*/
@Mappings({
@Mapping(source="id",target="userId"),
@Mapping(source="username",target="name"),
@Mapping(source="role.roleName",target="roleName")
})
publicabstractUserRoleDtotoUserRoleDto(Useruser);
/**
*提供默認(rèn)方法,方法自己定義,這個(gè)方法是我隨便寫(xiě)的,不是要按照這個(gè)格式來(lái)的
*@return
*/
UserRoleDtodefaultConvert(){
UserRoleDtouserRoleDto=newUserRoleDto();
userRoleDto.setUserId(0L);
userRoleDto.setName("None");
userRoleDto.setRoleName("None");
returnuserRoleDto;
}
}
5.可以使用多個(gè)參數(shù)
可以綁定多個(gè)對(duì)象的屬性值到目標(biāo)對(duì)象中:
packagecom.mapstruct.demo;
importorg.mapstruct.Mapper;
importorg.mapstruct.Mapping;
importorg.mapstruct.Mappings;
importorg.mapstruct.factory.Mappers;
/**
*@Mapper定義這是一個(gè)MapStruct對(duì)象屬性轉(zhuǎn)換接口,在這個(gè)類(lèi)里面規(guī)定轉(zhuǎn)換規(guī)則
*在項(xiàng)目構(gòu)建時(shí),會(huì)自動(dòng)生成改接口的實(shí)現(xiàn)類(lèi),這個(gè)實(shí)現(xiàn)類(lèi)將實(shí)現(xiàn)對(duì)象屬性值復(fù)制
*/
@Mapper
publicinterfaceUserRoleMapper{
/**
*獲取該類(lèi)自動(dòng)生成的實(shí)現(xiàn)類(lèi)的實(shí)例
*接口中的屬性都是publicstaticfinal的方法都是publicabstract的
*/
UserRoleMapperINSTANCES=Mappers.getMapper(UserRoleMapper.class);
/**
*這個(gè)方法就是用于實(shí)現(xiàn)對(duì)象屬性復(fù)制的方法
*
*@Mapping用來(lái)定義屬性復(fù)制規(guī)則source指定源對(duì)象屬性target指定目標(biāo)對(duì)象屬性
*
*@paramuser這個(gè)參數(shù)就是源對(duì)象,也就是需要被復(fù)制的對(duì)象
*@return返回的是目標(biāo)對(duì)象,就是最終的結(jié)果對(duì)象
*/
@Mappings({
@Mapping(source="id",target="userId"),
@Mapping(source="username",target="name"),
@Mapping(source="role.roleName",target="roleName")
})
UserRoleDtotoUserRoleDto(Useruser);
/**
*多個(gè)參數(shù)中的值綁定
*@paramuser源1
*@paramrole源2
*@return從源1、2中提取出的結(jié)果
*/
@Mappings({
@Mapping(source="user.id",target="userId"),//把user中的id綁定到目標(biāo)對(duì)象的userId屬性中
@Mapping(source="user.username",target="name"),//把user中的username綁定到目標(biāo)對(duì)象的name屬性中
@Mapping(source="role.roleName",target="roleName")//把role對(duì)象的roleName屬性值綁定到目標(biāo)對(duì)象的roleName中
})
UserRoleDtotoUserRoleDto(Useruser,Rolerole);
對(duì)比兩個(gè)方法~
5.直接使用參數(shù)作為屬性值
packagecom.mapstruct.demo;
importorg.mapstruct.Mapper;
importorg.mapstruct.Mapping;
importorg.mapstruct.Mappings;
importorg.mapstruct.factory.Mappers;
/**
*@Mapper定義這是一個(gè)MapStruct對(duì)象屬性轉(zhuǎn)換接口,在這個(gè)類(lèi)里面規(guī)定轉(zhuǎn)換規(guī)則
*在項(xiàng)目構(gòu)建時(shí),會(huì)自動(dòng)生成改接口的實(shí)現(xiàn)類(lèi),這個(gè)實(shí)現(xiàn)類(lèi)將實(shí)現(xiàn)對(duì)象屬性值復(fù)制
*/
@Mapper
publicinterfaceUserRoleMapper{
/**
*獲取該類(lèi)自動(dòng)生成的實(shí)現(xiàn)類(lèi)的實(shí)例
*接口中的屬性都是publicstaticfinal的方法都是publicabstract的
*/
UserRoleMapperINSTANCES=Mappers.getMapper(UserRoleMapper.class);
/**
*直接使用參數(shù)作為值
*@paramuser
*@parammyRoleName
*@return
*/
@Mappings({
@Mapping(source="user.id",target="userId"),//把user中的id綁定到目標(biāo)對(duì)象的userId屬性中
@Mapping(source="user.username",target="name"),//把user中的username綁定到目標(biāo)對(duì)象的name屬性中
@Mapping(source="myRoleName",target="roleName")//把role對(duì)象的roleName屬性值綁定到目標(biāo)對(duì)象的roleName中
})
UserRoleDtouseParameter(Useruser,StringmyRoleName);
}
測(cè)試類(lèi):
publicclassTest1{
Rolerole=null;
Useruser=null;
@Before
publicvoidbefore(){
role=newRole(2L,"administrator","超級(jí)管理員");
user=newUser(1L,"zhangsan","12345","17677778888","123@qq.com",role);
}
@Test
publicvoidtest1(){
UserRoleMapperinstances=UserRoleMapper.INSTANCES;
UserRoleDtouserRoleDto=instances.useParameter(user,"myUserRole");
System.out.println(userRoleDto);
}
}
6.更新對(duì)象屬性
在之前的例子中UserRoleDto useParameter(User user, String myRoleName);
都是通過(guò)類(lèi)似上面的方法來(lái)生成一個(gè)對(duì)象。而MapStruct提供了另外一種方式來(lái)更新一個(gè)對(duì)象中的屬性。@MappingTarget
publicinterfaceUserRoleMapper1{
UserRoleMapper1INSTANCES=Mappers.getMapper(UserRoleMapper1.class);
@Mappings({
@Mapping(source="userId",target="id"),
@Mapping(source="name",target="username"),
@Mapping(source="roleName",target="role.roleName")
})
voidupdateDto(UserRoleDtouserRoleDto,@MappingTargetUseruser);
@Mappings({
@Mapping(source="id",target="userId"),
@Mapping(source="username",target="name"),
@Mapping(source="role.roleName",target="roleName")
})
voidupdate(Useruser,@MappingTargetUserRoleDtouserRoleDto);
}
通過(guò)@MappingTarget來(lái)指定目標(biāo)類(lèi)是誰(shuí)(誰(shuí)的屬性需要被更新)。@Mapping還是用來(lái)定義屬性對(duì)應(yīng)規(guī)則。
以此為例說(shuō)明:
@Mappings({
@Mapping(source="id",target="userId"),
@Mapping(source="username",target="name"),
@Mapping(source="role.roleName",target="roleName")
})
voidupdate(Useruser,@MappingTargetUserRoleDtouserRoleDto);
@MappingTarget
標(biāo)注的類(lèi)UserRoleDto 為目標(biāo)類(lèi),user類(lèi)為源類(lèi),調(diào)用此方法,會(huì)把源類(lèi)中的屬性更新到目標(biāo)類(lèi)中。更新規(guī)則還是由@Mapping
指定。
7.沒(méi)有g(shù)etter/setter也能賦值
對(duì)于沒(méi)有g(shù)etter/setter的屬性也能實(shí)現(xiàn)賦值操作
publicclassCustomer{
privateLongid;
privateStringname;
//gettersandsetteromittedforbrevity
}
publicclassCustomerDto{
publicLongid;
publicStringcustomerName;
}
@Mapper
publicinterfaceCustomerMapper{
CustomerMapperINSTANCE=Mappers.getMapper(CustomerMapper.class);
@Mapping(source="customerName",target="name")
CustomertoCustomer(CustomerDtocustomerDto);
@InheritInverseConfiguration
CustomerDtofromCustomer(Customercustomer);
}
@Mapping(source = “customerName”, target = “name”)
不是用來(lái)指定屬性映射的,如果兩個(gè)對(duì)象的屬性名相同是可以省略@Mapping的。
MapStruct生成的實(shí)現(xiàn)類(lèi):
@Generated(
value="org.mapstruct.ap.MappingProcessor",
date="2019-02-14T1521+0800",
comments="version:1.3.0.Final,compiler:javac,environment:Java1.8.0_181(OracleCorporation)"
)
publicclassCustomerMapperImplimplementsCustomerMapper{
@Override
publicCustomertoCustomer(CustomerDtocustomerDto){
if(customerDto==null){
returnnull;
}
Customercustomer=newCustomer();
customer.setName(customerDto.customerName);
customer.setId(customerDto.id);
returncustomer;
}
@Override
publicCustomerDtotoCustomerDto(Customercustomer){
if(customer==null){
returnnull;
}
CustomerDtocustomerDto=newCustomerDto();
customerDto.customerName=customer.getName();
customerDto.id=customer.getId();
returncustomerDto;
}
}
@InheritInverseConfiguration
在這里的作用就是實(shí)現(xiàn)customerDto.customerName = customer.getName();
功能的。如果沒(méi)有這個(gè)注解,toCustomerDto這個(gè)方法則不會(huì)有customerName 和name兩個(gè)屬性的對(duì)應(yīng)關(guān)系的。
8.使用Spring依賴(lài)注入
@Data
@NoArgsConstructor
@AllArgsConstructor
publicclassCustomer{
privateLongid;
privateStringname;
}
@Data
publicclassCustomerDto{
privateLongid;
privateStringcustomerName;
}
//這里主要是這個(gè)componentModel屬性,它的值就是當(dāng)前要使用的依賴(lài)注入的環(huán)境
@Mapper(componentModel="spring")
publicinterfaceCustomerMapper{
@Mapping(source="name",target="customerName")
CustomerDtotoCustomerDto(Customercustomer);
}
@Mapper(componentModel = “spring”)
,表示把當(dāng)前Mapper類(lèi)納入spring容器??梢栽谄渌?lèi)中直接注入了:
@SpringBootApplication
@RestController
publicclassDemoMapstructApplication{
//注入Mapper
@Autowired
privateCustomerMappermapper;
publicstaticvoidmain(String[]args){
SpringApplication.run(DemoMapstructApplication.class,args);
}
@GetMapping("/test")
publicStringtest(){
Customercustomer=newCustomer(1L,"zhangsan");
CustomerDtocustomerDto=mapper.toCustomerDto(customer);
returncustomerDto.toString();
}
}
看一下由mapstruct自動(dòng)生成的類(lèi)文件,會(huì)發(fā)現(xiàn)標(biāo)記了@Component
注解。
@Generated(
value="org.mapstruct.ap.MappingProcessor",
date="2019-02-14T1517+0800",
comments="version:1.3.0.Final,compiler:javac,environment:Java1.8.0_181(OracleCorporation)"
)
@Component
publicclassCustomerMapperImplimplementsCustomerMapper{
@Override
publicCustomerDtotoCustomerDto(Customercustomer){
if(customer==null){
returnnull;
}
CustomerDtocustomerDto=newCustomerDto();
customerDto.setCustomerName(customer.getName());
customerDto.setId(customer.getId());
returncustomerDto;
}
}
9.自定義類(lèi)型轉(zhuǎn)換
有時(shí)候,在對(duì)象轉(zhuǎn)換的時(shí)候可能會(huì)出現(xiàn)這樣一個(gè)問(wèn)題,就是源對(duì)象中的類(lèi)型是Boolean類(lèi)型,而目標(biāo)對(duì)象類(lèi)型是String類(lèi)型,這種情況可以通過(guò)@Mapper
的uses屬性來(lái)實(shí)現(xiàn):
@Data
@NoArgsConstructor
@AllArgsConstructor
publicclassCustomer{
privateLongid;
privateStringname;
privateBooleanisDisable;
}
@Data
publicclassCustomerDto{
privateLongid;
privateStringcustomerName;
privateStringdisable;
}
定義轉(zhuǎn)換規(guī)則的類(lèi):
publicclassBooleanStrFormat{
publicStringtoStr(BooleanisDisable){
if(isDisable){
return"Y";
}else{
return"N";
}
}
publicBooleantoBoolean(Stringstr){
if(str.equals("Y")){
returntrue;
}else{
returnfalse;
}
}
}
定義Mapper,@Mapper( uses = { BooleanStrFormat.class})
,注意,這里的users屬性用于引用之前定義的轉(zhuǎn)換規(guī)則的類(lèi):
@Mapper(uses={BooleanStrFormat.class})
publicinterfaceCustomerMapper{
CustomerMapperINSTANCES=Mappers.getMapper(CustomerMapper.class);
@Mappings({
@Mapping(source="name",target="customerName"),
@Mapping(source="isDisable",target="disable")
})
CustomerDtotoCustomerDto(Customercustomer);
}
這樣子,Customer類(lèi)中的isDisable屬性的true就會(huì)轉(zhuǎn)變成CustomerDto中的disable屬性的yes。
MapStruct自動(dòng)生成的類(lèi)中的代碼:
@Generated(
value="org.mapstruct.ap.MappingProcessor",
date="2019-02-14T1618+0800",
comments="version:1.3.0.Final,compiler:javac,environment:Java1.8.0_181(OracleCorporation)"
)
publicclassCustomerMapperImplimplementsCustomerMapper{
//引用uses中指定的類(lèi)
privatefinalBooleanStrFormatbooleanStrFormat=newBooleanStrFormat();
@Override
publicCustomerDtotoCustomerDto(Customercustomer){
if(customer==null){
returnnull;
}
CustomerDtocustomerDto=newCustomerDto();
//轉(zhuǎn)換方式的使用
customerDto.setDisable(booleanStrFormat.toStr(customer.getIsDisable()));
customerDto.setCustomerName(customer.getName());
customerDto.setId(customer.getId());
returncustomerDto;
}
}
要注意的是,如果使用了例如像spring這樣的環(huán)境,Mapper引入uses類(lèi)實(shí)例的方式將是自動(dòng)注入,那么這個(gè)類(lèi)也應(yīng)該納入Spring容器:
CustomerMapper.java指定使用spring
@Mapper(componentModel="spring",uses={BooleanStrFormat.class})
publicinterfaceCustomerMapper{
CustomerMapperINSTANCES=Mappers.getMapper(CustomerMapper.class);
@Mappings({
@Mapping(source="name",target="customerName"),
@Mapping(source="isDisable",target="disable")
})
CustomerDtotoCustomerDto(Customercustomer);
}
轉(zhuǎn)換類(lèi)要加入Spring容器:
@Component
publicclassBooleanStrFormat{
publicStringtoStr(BooleanisDisable){
if(isDisable){
return"Y";
}else{
return"N";
}
}
publicBooleantoBoolean(Stringstr){
if(str.equals("Y")){
returntrue;
}else{
returnfalse;
}
}
}
MapStruct自動(dòng)生成的類(lèi):
@Generated(
value="org.mapstruct.ap.MappingProcessor",
date="2019-02-14T1635+0800",
comments="version:1.3.0.Final,compiler:javac,environment:Java1.8.0_181(OracleCorporation)"
)
@Component
publicclassCustomerMapperImplimplementsCustomerMapper{
//使用自動(dòng)注入的方式引入
@Autowired
privateBooleanStrFormatbooleanStrFormat;
@Override
publicCustomerDtotoCustomerDto(Customercustomer){
if(customer==null){
returnnull;
}
CustomerDtocustomerDto=newCustomerDto();
customerDto.setDisable(booleanStrFormat.toStr(customer.getIsDisable()));
customerDto.setCustomerName(customer.getName());
customerDto.setId(customer.getId());
returncustomerDto;
}
}
原文標(biāo)題:實(shí)體映射最強(qiáng)工具類(lèi):MapStruct 真香!
-
數(shù)據(jù)傳輸
+關(guān)注
關(guān)注
9文章
1698瀏覽量
64211 -
JAVA
+關(guān)注
關(guān)注
19文章
2943瀏覽量
104096 -
User
+關(guān)注
關(guān)注
1文章
27瀏覽量
10761
原文標(biāo)題:實(shí)體映射最強(qiáng)工具類(lèi):MapStruct 真香!
文章出處:【微信號(hào):AndroidPush,微信公眾號(hào):Android編程精選】歡迎添加關(guān)注!文章轉(zhuǎn)載請(qǐng)注明出處。
發(fā)布評(píng)論請(qǐng)先 登錄
相關(guān)推薦
評(píng)論