Find service inventory
[externalapi/nbi.git] / src / main / java / org / onap / nbi / apis / serviceinventory / jolt / FindServiceInventoryJsonTransformer.java
index 05f789f..70fe0c8 100644 (file)
  */
 package org.onap.nbi.apis.serviceinventory.jolt;
 
+import com.bazaarvoice.jolt.Chainr;
+import com.bazaarvoice.jolt.JsonUtils;
+import com.bazaarvoice.jolt.exception.JoltException;
+import java.util.LinkedHashMap;
 import java.util.List;
 import org.onap.nbi.exceptions.TechnicalException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
-import com.bazaarvoice.jolt.Chainr;
-import com.bazaarvoice.jolt.JsonUtils;
-import com.bazaarvoice.jolt.exception.JoltException;
 
 @Service
 public class FindServiceInventoryJsonTransformer {
@@ -34,15 +35,13 @@ public class FindServiceInventoryJsonTransformer {
         this.chainr = Chainr.fromSpec(specs);
     }
 
-    public Object transform(Object serviceSpec) {
-        Object output = null;
+    public List<LinkedHashMap> transform(List<LinkedHashMap> serviceSpec) {
         try {
-            output = chainr.transform(serviceSpec);
+            return (List<LinkedHashMap>)chainr.transform(serviceSpec);
         } catch (JoltException joE) {
             LOGGER.error("Unable to transform SDC response with JOLT Transformer", joE);
             throw new TechnicalException("Error while parsing ONAP response");
         }
-        return output;
     }
 
 }