Let say I have the following protobuf file
message Body{
map<string, string> message_body 1;
}
And what I want to do is use mapstruct to map this to a Java String. Something like this
@Mapping(target = "messageBody", source = "messageBody", qualifiedByName = "logBodyToMessageBody")
MessageBody logMessageToMessageBody(LogMessageProtoBuf.Body body);
And my MessageBody class looks like this
public class MessageBody implements Serializable {
@Column
private String messageBody
}
And lets say I use the following custom mapper below
@Named("logBodyToMessageBody")
public String logBodyToMessageBody(LogMessageProtoBuf.Body body) {
return body.toString();
Each time I try to build the project, mapstruct is telling me that it can't map the fields and that I should use a custom mapper. I am using a custom mapper but it doesn't even get to the point where it either sees or it does not like the custom mapper. Could someone please help me implement the custom mapper where I can take the values from my proto file and convert it to its java equivalent above?