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

ai.stapi.graphsystem.fixtures.fixtureCommandsGenerator.FixtureCommandsGeneratorResult Maven / Gradle / Ivy

package ai.stapi.graphsystem.fixtures.fixtureCommandsGenerator;

import com.fasterxml.jackson.annotation.JsonIgnore;
import ai.stapi.graphsystem.messaging.command.Command;
import java.io.Serializable;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

public class FixtureCommandsGeneratorResult implements Serializable {

  private String generatorClassName;
  private List commandDefinitions;
  private boolean oneTimeGenerator = false;
  private Set processedFiles;

  private FixtureCommandsGeneratorResult() {
  }

  public FixtureCommandsGeneratorResult(
      Class generatorClassName,
      List commands
  ) {
    this.generatorClassName = generatorClassName.getName();
    this.commandDefinitions =
        commands.stream().map(CommandDefinition::new).collect(Collectors.toList());
    this.processedFiles = new HashSet<>();
    this.oneTimeGenerator = true;
  }

  public FixtureCommandsGeneratorResult(
      Class generatorClassName,
      List commands,
      Set processedFiles
  ) {
    this.generatorClassName = generatorClassName.getName();
    this.commandDefinitions =
        commands.stream().map(CommandDefinition::new).collect(Collectors.toList());
    this.processedFiles = processedFiles;
    this.oneTimeGenerator = false;
  }

  public String getGeneratorClassName() {
    return generatorClassName;
  }

  @JsonIgnore
  public List getCommands() {
    return commandDefinitions.stream().map(CommandDefinition::getCommand)
        .collect(Collectors.toList());
  }

  public List getCommandDefinitions() {
    return commandDefinitions;
  }

  public boolean isOneTimeGenerator() {
    return oneTimeGenerator;
  }

  public Set getProcessedFiles() {
    return this.processedFiles;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy