-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Use case
The reasons are as follows:
-
gRPC use protobuf ,Jakarta EE 10 choise gRPC as Jakarta RPC , . Net Core same choise gRPC.
-
It is a good idea in the near future that protobuf will be selected as the data exchange foundation of heterogeneous platforms for service mash of microservice architecture.
-
MapStruct is not friendly to protobuf. For a long time, it will inevitably generate new components instead of building on the MapStruct foundation. It may introduce technologies similar to ByteBuf to improve the copy efficiency.
-
No configuration is better than complex configuration. Most people choose MapStruct not to learn complex configuration, but to improve efficiency. In complex scenarios, customers write code instead of configuring MapStruct, which seems to go further and further. What is the original intention of the project? Is the goal of the project to solve complex situations through configuration?
I look forward to your reply!
Generated Code
Bean Map copy to Protobuf Map putAll Error : UnsupportedOperationException.
correct:
basicTestMessageMap.putAllTestStrMap(map);
replace
basicTestMessageMap.getTestStrMap().putAll( map );
@Override
public BasicTestMessageMap toMap(BasicTestBeanMap beanMap) {
if ( beanMap == null ) {
return null;
}
BasicTestMessageMap.Builder basicTestMessageMap = BasicTestMessageMap.newBuilder();
if ( basicTestMessageMap.getTestStrMap() != null ) {
Map<String, String> map = beanMap.getTestStrMap();
if ( map != null ) {
basicTestMessageMap.getTestStrMap().putAll( map );
}
}
return basicTestMessageMap.build();
}
Possible workarounds
No response
MapStruct Version
1.5.3.Final