Код: Выделить всё
` public class Source {
private Person[] people;
// Getter and Setter
}
public class Destination {
частное лицо;
Код: Выделить всё
// Getter and Setter
}
public class Person {
частное строковое имя;
Код: Выделить всё
// Getter and Setter
}
@Mapper
публичный интерфейс MyMapper {
MyMapper INSTANCE = Mappers.getMapper(MyMapper.class);
Код: Выделить всё
@Mapping(source = "people[0]", target = "person")
Destination mapToDestination(Source source);`
Подробнее здесь: https://stackoverflow.com/questions/776 ... mapstructs
Мобильная версия