작성
·
262
0
GithubRepository githubRepository = new GithubRepository();
githubRepository.setUser("dnom");
githubRepository.setName("live-study");
GithubIssue githubIssue = new GithubIssue(githubRepository);
githubIssue.setId(1);
githubIssue.setTitle("Issue : JVM Memory 부족");
ModelMapper modelMapper = new ModelMapper();
GithubIssueData githubIssueData = modelMapper.map(githubIssue, GithubIssueData.class);
public class GithubIssueData {
private int id;
private String title;
private String repositoryUser;
private String repositoryName;
... 생략
}
public class GithubIssue implements Cloneable{
private int id;
private String title;
private GithubRepository githubRepository;
... 생략
}
public class GithubRepository {
private String User;
private String Name;
... 생략
}
답변 1
1
오.. 저도 저런게 되는지 몰랐습니다. 앞에 github이라는게 붙어있어도 된다면 뭔가 ModelMapper 쪽에서 공통적인 prefix를 무시하는 기능 같은데 있는게 아닐까 생각이 드네요.