use of org.eclipse.winery.model.tosca.yaml.YTRelationshipType in project winery by eclipse.
the class YamlRepository method replaceOldRelationshipTypeWithNewData.
/**
* Replaces old data of yaml relationship type with new data from xml relationship type to prevent deletion of
* implementation artifacts
*
* @param newData new saved relationship type
* @param oldData already saved relationship type
* @return edited yaml service template
*/
private YTServiceTemplate replaceOldRelationshipTypeWithNewData(YTServiceTemplate newData, YTServiceTemplate oldData) {
YTRelationshipType oldRelationshipType = oldData.getRelationshipTypes().entrySet().iterator().next().getValue();
YTRelationshipType newRelationshipType = newData.getRelationshipTypes().entrySet().iterator().next().getValue();
oldRelationshipType.setMetadata(newRelationshipType.getMetadata());
oldRelationshipType.setProperties(newRelationshipType.getProperties());
oldRelationshipType.setDerivedFrom(newRelationshipType.getDerivedFrom());
oldRelationshipType.setDescription(newRelationshipType.getDescription());
oldRelationshipType.setInterfaces(newRelationshipType.getInterfaces());
oldRelationshipType.setValidTargetTypes(newRelationshipType.getValidTargetTypes());
oldData.getRelationshipTypes().entrySet().iterator().next().setValue(oldRelationshipType);
return oldData;
}
use of org.eclipse.winery.model.tosca.yaml.YTRelationshipType in project winery by eclipse.
the class FromCanonical method convertRelationshipTypeImplementation.
@Deprecated
public YTServiceTemplate convertRelationshipTypeImplementation(YTServiceTemplate type, TRelationshipTypeImplementation node) {
if (Objects.isNull(node)) {
return null;
}
YTRelationshipType relationshipType = type.getRelationshipTypes().entrySet().iterator().next().getValue();
// relationshipType.setInterfaces(convertRelationshipInterfaces(relationshipType.getInterfaces(), node.getImplementationArtifacts()));
type.getRelationshipTypes().entrySet().iterator().next().setValue(relationshipType);
return type;
}
Aggregations