update sparky with configurable features
[aai/sparky-be.git] / sparkybe-onap-service / src / main / java / org / onap / aai / sparky / viewandinspect / config / VisualizationConfigs.java
index acca775..80328d3 100644 (file)
@@ -21,6 +21,7 @@
 package org.onap.aai.sparky.viewandinspect.config;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 
 import org.onap.aai.sparky.config.SparkyResourceLoader;
 
@@ -61,6 +62,22 @@ public class VisualizationConfigs {
   public void setShallowEntities(ArrayList<String> shallowEntities) {
     this.shallowEntities = shallowEntities;
   }
+  
+  public void setDelimitedShallowEntities(String delimitedShallowEntites) {
+
+    if (delimitedShallowEntites == null) {
+      this.shallowEntities = new ArrayList<>();
+      return;
+    }
+
+    try {
+      this.shallowEntities =
+          new ArrayList<String>(Arrays.asList(delimitedShallowEntites.split(",")));
+    } catch (Exception exc) {
+      this.shallowEntities = new ArrayList<>();
+    }
+
+  }
 
   /**
    * Make all neighbors bidirectional.