use of org.eclipse.winery.model.tosca.yaml.support.YTMapRequirementDefinition in project winery by eclipse.
the class FromCanonical method convert.
public YTMapRequirementDefinition convert(TRequirementDefinition node) {
if (Objects.isNull(node)) {
return null;
}
YTRequirementDefinition.Builder builder = new YTRequirementDefinition.Builder(node.getCapability()).setDescription(convertDocumentation(node.getDocumentation())).setOccurrences(node.getLowerBound(), node.getUpperBound()).setNode(node.getNode());
if (node.getRelationship() != null) {
YTRelationshipDefinition.Builder relationshipDefBuilder = new YTRelationshipDefinition.Builder(node.getRelationship());
builder = builder.setRelationship(relationshipDefBuilder.build());
}
return new YTMapRequirementDefinition().setMap(Collections.singletonMap(node.getName(), builder.build()));
}
use of org.eclipse.winery.model.tosca.yaml.support.YTMapRequirementDefinition in project winery by eclipse.
the class YamlBuilder method buildMapRequirementDefinition.
@Nullable
public YTMapRequirementDefinition buildMapRequirementDefinition(Object object, Parameter<YTMapRequirementDefinition> parameter) {
YTMapRequirementDefinition result = new YTMapRequirementDefinition();
put(result, parameter.getValue(), buildRequirementDefinition(object, new Parameter<>(parameter.getContext())));
return result;
}
Aggregations