net.nemerosa.ontrack.model.structure.TemplateInstanceExecution Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ontrack-model Show documentation
Show all versions of ontrack-model Show documentation
Ontrack module: ontrack-model
package net.nemerosa.ontrack.model.structure;
import lombok.Data;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* Execution context for the creation of a template instance.
*/
@Data
public class TemplateInstanceExecution {
/**
* Replacement function to use
*/
private final Function replacementFn;
/**
* List of resolved template definition parameters
*/
private final Map parameterValues;
/**
* Performs a replacement
*/
public String replace(String value) {
return replacementFn.apply(value);
}
public List asTemplateParameterValues() {
return parameterValues.entrySet().stream()
.map(entry -> new TemplateParameterValue(entry.getKey(), entry.getValue()))
.collect(Collectors.toList());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy