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

tech.jhipster.lite.project.infrastructure.secondary.PersistedProjectHistory Maven / Gradle / Ivy

There is a newer version: 1.22.0
Show newest version
package tech.jhipster.lite.project.infrastructure.secondary;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Collection;
import tech.jhipster.lite.project.domain.ProjectPath;
import tech.jhipster.lite.project.domain.history.ProjectHistory;

final class PersistedProjectHistory {

  private final Collection actions;

  private PersistedProjectHistory(@JsonProperty("actions") Collection actions) {
    this.actions = actions;
  }

  static PersistedProjectHistory from(ProjectHistory history) {
    return new PersistedProjectHistory(history.actions().stream().map(PersistedProjectAction::from).toList());
  }

  public ProjectHistory toDomain(ProjectPath path) {
    return new ProjectHistory(path, getActions().stream().map(PersistedProjectAction::toDomain).toList());
  }

  public Collection getActions() {
    return actions;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy