我刚开始使用MapStruct,因此也面临着同样的问题。我有以下的示范课程:class User {
private String fullName;
private List<Experiencereturn nameParts[0];//similarly have a lastNameExtractor在源参数中不存在名为"fullName“的属性您<
对于目标类的特定属性,我有一个映射器,它需要从源对象内的对象列表中选择一个,并使用不同的mapper类映射它。简化了很多,Game类包含一个Transaction对象列表,我的GameMapper类如下所示:@Mapper(injectionStrategy = InjectionStrategy.CONSTRUCTOREventMapper作为private final EventMappe
public class Page { Long userId; Long userId;我现在的地图是这样的ReportingPolicy.IGNORE ) Book map(BookWriteModel bookWriteModel, User user);将userId映射到页面上的userId的更简