1
考慮下面以模型Modelmapper與綜合性能
class Project {
String groupId;
String artifactId;
String version;
}
class ProjectWithId {
String id;
String groupId;
String artifactId;
String version;
}
我將如何使用ModelMapper正確地的groupId,artifactId和version的值相結合?例如。是有一些方法來避免以下情況:
ProjectWithId projectWithId = modelMapper.map(project, ProjectWithId.class);
projectWithId.setId(project.getGroupId() + ":" + project.getArtifactId() + ":" + project.getVersion());