Fix sonar issues
[dcaegen2/platform.git] / mod / bpgenerator / onap / src / main / java / org / onap / blueprintgenerator / service / common / InterfacesService.java
index bfd14a4..c19ad09 100644 (file)
@@ -4,6 +4,7 @@
  *  *  org.onap.dcae
  *  *  ================================================================================
  *  *  Copyright (c) 2020  AT&T Intellectual Property. All rights reserved.
+ *  *  Copyright (c) 2021 Nokia. All rights reserved.
  *  *  ================================================================================
  *  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  *  you may not use this file except in compliance with the License.
@@ -30,31 +31,34 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.HashMap;
-import java.util.LinkedHashMap;
 import java.util.Map;
 
 /**
  * @author : Ravi Mantena
- * @date 10/16/2020
- * Application: ONAP - Blueprint Generator
- * Common ONAP Service used by ONAP and DMAAP Blueprint to add Interfaces
+ * @date 10/16/2020 Application: ONAP - Blueprint Generator Common ONAP Service to add Interfaces
  */
-
-
 @Service
 public class InterfacesService {
 
     @Autowired
     private StartService startService;
 
-    // Method to create Interface to include Start and Start inputs sections in BP
-    public Map<String,Object> createInterface(Map<String, LinkedHashMap<String, Object>> inputs, OnapComponentSpec onapComponentSpec){
+    /**
+     * Creates Interface to include Start and Start inputs sections in BP for given Inputs and
+     * ComponentSpec
+     *
+     * @param inputs Inputs
+     * @param onapComponentSpec  OnapComponentSpec
+     * @return
+     */
+    public Map<String, Object> createInterface(
+        Map<String, Map<String, Object>> inputs, OnapComponentSpec onapComponentSpec) {
 
-        Map<String,Object> response = new HashMap<>();
+        Map<String, Object> response = new HashMap<>();
         Interfaces interfaces = new Interfaces();
 
         Map<String, Object> startResponse = startService.createStart(inputs, onapComponentSpec);
-        inputs = (Map<String, LinkedHashMap<String, Object>>) startResponse.get("inputs");
+        inputs = (Map<String, Map<String, Object>>) startResponse.get("inputs");
 
         interfaces.setStart((Start) startResponse.get("start"));
 
@@ -62,6 +66,4 @@ public class InterfacesService {
         response.put("inputs", inputs);
         return response;
     }
-
 }
-