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

tech.jhipster.lite.project.domain.history.ProjectActionsAppender Maven / Gradle / Ivy

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

import tech.jhipster.lite.project.domain.ProjectsRepository;
import tech.jhipster.lite.shared.error.domain.Assert;

public class ProjectActionsAppender {

  private final ProjectsRepository projects;

  public ProjectActionsAppender(ProjectsRepository projects) {
    Assert.notNull("projects", projects);

    this.projects = projects;
  }

  public void append(ProjectActionToAppend actionToAppend) {
    ProjectHistory history = projects.getHistory(actionToAppend.path());

    history.append(actionToAppend.action());

    projects.save(history);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy