use of org.eclipse.jgit.annotations.NonNull in project winery by eclipse.
the class ConsistencyChecker method checkServiceTemplate.
public static void checkServiceTemplate(ConsistencyErrorLogger errorLogger, ConsistencyCheckerConfiguration configuration, ServiceTemplateId id) {
final TServiceTemplate serviceTemplate = configuration.getRepository().getElement(id);
if (serviceTemplate.getTopologyTemplate() == null) {
return;
}
@NonNull final List<TNodeTemplate> nodeTemplates = serviceTemplate.getTopologyTemplate().getNodeTemplates();
for (TNodeTemplate nodeTemplate : nodeTemplates) {
final TNodeType nodeType = configuration.getRepository().getElement(new NodeTypeId(nodeTemplate.getType()));
final WinerysPropertiesDefinition winerysPropertiesDefinition = nodeType.getWinerysPropertiesDefinition();
if (winerysPropertiesDefinition != null) {
PropertyDefinitionKVList list = winerysPropertiesDefinition.getPropertyDefinitionKVList();
if (list != null) {
// iterate on all defined properties
for (PropertyDefinitionKV propdef : list) {
String key = propdef.getKey();
if (key == null) {
printAndAddError(errorLogger, configuration.getVerbosity(), id, "key is null");
continue;
}
// assign value, but change "null" to "" if no property is defined
final Map<String, String> propertiesKV = ModelUtilities.getPropertiesKV(nodeTemplate);
if (propertiesKV == null) {
printAndAddError(errorLogger, configuration.getVerbosity(), id, "propertiesKV of node template " + nodeTemplate.getId() + " is null");
}
}
}
}
}
}
Aggregations