All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tech.jhipster.lite.project.infrastructure.primary.RestProjectHistory Maven / Gradle / Ivy

There is a newer version: 1.22.0
Show newest version
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;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy