Я знаю, что есть аналогичный вопрос (см. вопрос), но я не нашел там полезного ответа. Допустим, у меня есть следующие классы:
class QuestionType {
private String type;
}
class Profile {
private String name;
private int id;
}
class ProfileResponse {
private String name;
private int id;
private String type;
}
Как я мог преобразовать HashMap<QuestionType, Profile>
в List<ProfileResponse>
с помощью MapStruct (1.3.1)
@Mapper(componentModel = "spring")
public interface ProfileResponseMapper {
List<ProfileResponse> toProfileResponse(Map<QuestionType, Profile> profiles);
}