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

tech.jhipster.lite.project.infrastructure.secondary.PersistedProjectAction 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.time.Instant;
import java.util.Map;
import tech.jhipster.lite.project.domain.history.ProjectAction;

final class PersistedProjectAction {

  private final String module;
  private final Instant date;
  private final Map properties;

  private PersistedProjectAction(
    @JsonProperty("module") String module,
    @JsonProperty("date") Instant date,
    @JsonProperty("properties") Map properties
  ) {
    this.module = module;
    this.date = date;
    this.properties = properties;
  }

  static PersistedProjectAction from(ProjectAction action) {
    return new PersistedProjectAction(action.module().get(), action.date(), action.parameters().get());
  }

  ProjectAction toDomain() {
    return ProjectAction.builder().module(getModule()).date(getDate()).parameters(getProperties());
  }

  public String getModule() {
    return module;
  }

  public Instant getDate() {
    return date;
  }

  public Map getProperties() {
    return properties;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy