tech.jhipster.lite.project.infrastructure.primary.RestProjectHistory Maven / Gradle / Ivy
package tech.jhipster.lite.project.infrastructure.primary;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Collection;
import java.util.Map;
import tech.jhipster.lite.project.domain.history.ProjectHistory;
@Schema(name = "ProjectHistory", description = "Information on the JHipster project history")
final class RestProjectHistory {
private final Collection modules;
private final Map properties;
private RestProjectHistory(Collection modules, Map properties) {
this.modules = modules;
this.properties = properties;
}
public static RestProjectHistory from(ProjectHistory history) {
return new RestProjectHistory(history.actions().stream().map(RestAppliedModule::from).toList(), history.latestProperties().get());
}
@Schema(description = "Modules applied for the project")
public Collection getModules() {
return modules;
}
@Schema(description = "Properties used when applying modules to the project")
public Map getProperties() {
return properties;
}
}