use of alien4cloud.topology.task.AbstractRelationshipTask in project alien4cloud by alien4cloud.
the class TopologyAbstractRelationshipValidationService method getTaskListFromMapArray.
/**
* Constructs a TopologyTask list given a Map (node template name => component) and the code
*/
private <T extends AbstractInheritableToscaType> List<AbstractRelationshipTask> getTaskListFromMapArray(Map<String, T[]> components, TaskCode taskCode) {
List<AbstractRelationshipTask> taskList = Lists.newArrayList();
for (Map.Entry<String, T[]> entry : components.entrySet()) {
for (AbstractInheritableToscaType compo : entry.getValue()) {
AbstractRelationshipTask task = new AbstractRelationshipTask();
task.setNodeTemplateName(entry.getKey());
task.setComponent(compo);
task.setCode(taskCode);
taskList.add(task);
}
}
if (taskList.isEmpty()) {
return null;
} else {
return taskList;
}
}
Aggregations