summaryrefslogtreecommitdiffstats
path: root/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/GraphVertex.java
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/GraphVertex.java')
-rw-r--r--catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/GraphVertex.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/GraphVertex.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/GraphVertex.java
index 2db22a72b0..11dcdceaaf 100644
--- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/GraphVertex.java
+++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/jsongraph/GraphVertex.java
@@ -21,6 +21,7 @@
package org.openecomp.sdc.be.dao.jsongraph;
import org.janusgraph.core.JanusGraphVertex;
+import com.google.common.base.Strings;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang.StringUtils;
import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum;
@@ -87,6 +88,13 @@ public class GraphVertex {
}
public ComponentTypeEnum getType() {
+ if(getMetadataProperty(GraphPropertyEnum.COMPONENT_TYPE) == null) {
+ if (getMetadataProperty(GraphPropertyEnum.RESOURCE_TYPE) != null) {
+ return ComponentTypeEnum.RESOURCE;
+ }
+ return null;
+ }
+
return ComponentTypeEnum.valueOf((String) getMetadataProperty(GraphPropertyEnum.COMPONENT_TYPE));
}
@@ -121,7 +129,7 @@ public class GraphVertex {
public void getOrSetDefaultInstantiationTypeForToscaElementJson(){
String toscaVertexJsonInstantiationType;
toscaVertexJsonInstantiationType = (String)(this.getJsonMetadataField(JsonPresentationFields.INSTANTIATION_TYPE));
- if (toscaVertexJsonInstantiationType == StringUtils.EMPTY || toscaVertexJsonInstantiationType == null){
+ if (Strings.isNullOrEmpty(toscaVertexJsonInstantiationType)) {
this.setJsonMetadataField(JsonPresentationFields.INSTANTIATION_TYPE, InstantiationTypes.A_LA_CARTE.getValue());
};
};