Have a target type, formed by Lombok:
@Data
@Builder
class Target {
private final String a;
}
and have a DTO:
@Value
@Builder
class DTO {
private final String a;
}
Mapper:
@Mapper(componentModel = "spring")
interface Mapper {
void update(DTO dto, @MappingTarget Target target);
}
But when I compile (saw something related to JDK 11, and yes, it is 11 in my case), the compiled method is empty:
public void update(DTO source, Target target) {
if (source == null) {
return;
}
}
And this is only relevant to MappingTarget. Using regular Mapping methods of 'createFromDTO' works correctly.
MapStruct 1.3.0