Fix Checkstyle issues
[clamp.git] / src / main / java / org / onap / clamp / clds / model / properties / ModelProperties.java
index 61eeac1..9b7f85d 100644 (file)
@@ -5,6 +5,8 @@
  * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
  *                             reserved.
  * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -118,26 +120,27 @@ public class ModelProperties {
             // Parse the list of base Model Elements and build up the
             // ModelElements
             modelElementClasses.entrySet().stream().parallel()
-                .filter(entry -> (AbstractModelElement.class.isAssignableFrom(entry.getKey())
-                    && missingTypes.contains(entry.getValue())))
-                .forEach(entry -> {
-                    try {
-                        modelElements.put(entry.getValue(),
-                            (entry.getKey().getConstructor(ModelProperties.class, ModelBpmn.class, JsonObject.class)
-                                .newInstance(this, modelBpmn, modelJson)));
-                    } catch (InstantiationException | NoSuchMethodException | IllegalAccessException
-                        | InvocationTargetException e) {
-                        logger.warn("Unable to instantiate a ModelElement "+ entry.getValue()+", exception follows: ", e);
-                    }
-                });
+                    .filter(entry -> (AbstractModelElement.class.isAssignableFrom(entry.getKey())
+                            && missingTypes.contains(entry.getValue())))
+                    .forEach(entry -> {
+                        try {
+                            modelElements.put(entry.getValue(),
+                                    (entry.getKey().getConstructor(ModelBpmn.class, JsonObject.class)
+                                            .newInstance(modelBpmn, modelJson)));
+                        } catch (InstantiationException | NoSuchMethodException | IllegalAccessException
+                                | InvocationTargetException e) {
+                            logger.warn("Unable to instantiate a ModelElement " + entry.getValue()
+                                    + ", exception follows: ", e);
+                        }
+                    });
         }
     }
 
     /**
      * Get the VF for a model. If return null if there is no VF.
      *
-     * @param model
-     * @return
+     * @param model The clds model
+     * @return The vf of the model
      */
     public static String getVf(CldsModel model) {
         List<String> vfs = null;
@@ -174,6 +177,7 @@ public class ModelProperties {
     }
 
     /**
+     * Get the model name.
      * @return the modelName
      */
     public String getModelName() {
@@ -181,6 +185,7 @@ public class ModelProperties {
     }
 
     /**
+     * Get the control name.
      * @return the controlName
      */
     public String getControlName() {
@@ -188,6 +193,7 @@ public class ModelProperties {
     }
 
     /**
+     * Get the control name qnd policy uniqueId.
      * @return the controlNameAndPolicyUniqueId
      */
     public String getControlNameAndPolicyUniqueId() {
@@ -195,6 +201,7 @@ public class ModelProperties {
     }
 
     /**
+     * Get the current policy name.
      * @return the currentPolicyName
      */
     private String getCurrentPolicyName() {
@@ -206,6 +213,7 @@ public class ModelProperties {
     }
 
     /**
+     * Get the current policy scope and policy name.
      * @return the currentPolicyScopeAndPolicyName
      */
     public String getCurrentPolicyScopeAndPolicyName() {
@@ -213,6 +221,7 @@ public class ModelProperties {
     }
 
     /**
+     * Get policy name for dcae deploy.
      * @return The policyName that wil be used in input parameters of DCAE deploy
      */
     public String getPolicyNameForDcaeDeploy(ClampProperties refProp) {
@@ -221,6 +230,7 @@ public class ModelProperties {
     }
 
     /**
+     * Get policy scope and name with uniqueid.
      * @return the policyScopeAndNameWithUniqueId
      */
     public String getPolicyScopeAndNameWithUniqueId() {
@@ -229,6 +239,7 @@ public class ModelProperties {
     }
 
     /**
+     * Get policy scope and name with unique guardid.
      * @return the policyScopeAndNameWithUniqueId
      */
     public String getPolicyScopeAndNameWithUniqueGuardId() {
@@ -237,6 +248,7 @@ public class ModelProperties {
     }
 
     /**
+     * Get current policy scope and full policy name.
      * @return the currentPolicyScopeAndFullPolicyName
      */
     public String getCurrentPolicyScopeAndFullPolicyName(String policyNamePrefix) {
@@ -245,6 +257,7 @@ public class ModelProperties {
     }
 
     /**
+     * Get policy name with scope context.
      * @return the PolicyNameWithScopeContext
      */
     public String getPolicyNameWithScopeContext(String policyScope, String policyType, String vnfScope, String context,
@@ -254,6 +267,7 @@ public class ModelProperties {
     }
 
     /**
+     * Get policy name with prefix scope context.
      * @return the PolicyNameWithPrefixScopeContext
      */
     public String getPolicyNameWithPrefixScopeContext(String policyScope, String policyType, String vnfScope,
@@ -265,14 +279,15 @@ public class ModelProperties {
     /**
      * Replace all '-' with '_' within policy scope and name.
      *
-     * @param inName
-     * @return
+     * @param inName policy scope and name
+     * @return policy scope and name with "-" replaced with "_"
      */
     private String normalizePolicyScopeName(String inName) {
         return inName.replaceAll("-", "_");
     }
 
     /**
+     * Get current model element id.
      * @return the currentModelElementId
      */
     public String getCurrentModelElementId() {
@@ -291,6 +306,7 @@ public class ModelProperties {
     }
 
     /**
+     * Get policy uniqueId.
      * @return the policyUniqueId
      */
     public String getPolicyUniqueId() {
@@ -317,6 +333,7 @@ public class ModelProperties {
     }
 
     /**
+     * Get actioncd.
      * @return the actionCd
      */
     public String getActionCd() {
@@ -324,6 +341,7 @@ public class ModelProperties {
     }
 
     /**
+     * Get the testOnly flag value.
      * @return the testOnly
      */
     public boolean isTestOnly() {
@@ -331,6 +349,7 @@ public class ModelProperties {
     }
 
     /**
+     * Get the global value.
      * @return the global
      */
     public Global getGlobal() {
@@ -340,6 +359,12 @@ public class ModelProperties {
         return global;
     }
 
+    /**
+     * Registers model element.
+     *
+     * @param modelElementClass model element class
+     * @param type model element type
+     */
     public static final synchronized void registerModelElement(Class<? extends AbstractModelElement> modelElementClass,
         String type) {
         if (!modelElementClasses.containsKey(modelElementClass.getClass())) {