use of org.eclipse.winery.model.tosca.extensions.kvproperties.ParameterDefinition in project winery by eclipse.
the class ToCanonical method convert.
public TActivityDefinition convert(YTMapActivityDefinition node) {
if (Objects.isNull(node) || node.getMap().isEmpty()) {
return null;
}
for (YTActivityDefinition value : node.getMap().values()) {
if (value instanceof YTCallOperationActivityDefinition) {
YTCallOperationActivityDefinition yamlDef = (YTCallOperationActivityDefinition) value;
TCallOperationActivityDefinition canonicalDef = new TCallOperationActivityDefinition(yamlDef.getOperation());
List<ParameterDefinition> inputs = yamlDef.getInputs().entrySet().stream().map(entry -> convert(entry.getValue(), entry.getKey())).collect(Collectors.toList());
canonicalDef.setInputs(inputs);
return canonicalDef;
}
}
return null;
}
use of org.eclipse.winery.model.tosca.extensions.kvproperties.ParameterDefinition in project winery by eclipse.
the class ToCanonical method convert.
private ParameterDefinition convert(YTParameterDefinition node, String name) {
if (node == null) {
return null;
}
ParameterDefinition p = new ParameterDefinition();
p.setKey(name);
p.setType(node.getType());
p.setDescription(node.getDescription());
p.setRequired(node.getRequired());
p.setDefaultValue(ValueHelper.toString(node.getDefault()));
p.setValue(ValueHelper.toString(node.getValue()));
return p;
}
Aggregations